Windows terminal not showing cursor for couple minutes when starting #13188

Closed
opened 2026-01-31 03:36:09 +00:00 by claunia · 17 comments
Owner

Originally created by @mjrlgue on GitHub (Mar 25, 2021).

Windows Terminal version (or Windows build number)

Microsoft Windows [version 10.0.19042.867]

Other Software

Powershell 7.1.0

Steps to reproduce

I was trying to update my windows terminal theme from settings?json, I forgot to close a bracket in my json file after that when I started windows terminal, the window open but the cursor and the path PS C:\Users\Myuser doesn't show for at least 3 minutes

Expected Behavior

No response

Actual Behavior

After 3 minutes approx, it print this message in red OperationStopped: The open file is no longer valid because the volume that contains it has been damaged externally. then it shows the cursor and display the path: PS c:\Users\MyUser

I just updated windows to the lastest version to install windows temrinal, but it's bugging :/

Originally created by @mjrlgue on GitHub (Mar 25, 2021). ### Windows Terminal version (or Windows build number) Microsoft Windows [version 10.0.19042.867] ### Other Software Powershell 7.1.0 ### Steps to reproduce I was trying to update my windows terminal theme from `settings?json`, I forgot to close a bracket in my json file after that when I started windows terminal, the window open but the cursor and the path `PS C:\Users\Myuser` doesn't show for at least 3 minutes ### Expected Behavior _No response_ ### Actual Behavior After 3 minutes approx, it print this message in red `OperationStopped: The open file is no longer valid because the volume that contains it has been damaged externally.` then it shows the cursor and display the path: `PS c:\Users\MyUser` I just updated windows to the lastest version to install windows temrinal, but it's bugging :/
Author
Owner

@DHowett commented on GitHub (Mar 25, 2021):

If you open powershell without Terminal, what happens?

@DHowett commented on GitHub (Mar 25, 2021): If you open powershell **without** Terminal, what happens?
Author
Owner

@mjrlgue commented on GitHub (Mar 26, 2021):

same thing with powershell prints the same message OperationStopped ...

@mjrlgue commented on GitHub (Mar 26, 2021): same thing with powershell prints the same message `OperationStopped ...`
Author
Owner

@zadjii-msft commented on GitHub (Mar 26, 2021):

Well good, then we know this isn't specific to the Terminal!

  • What about cmd.exe, does that work?
  • Does powershell --nologo -noprofile?
@zadjii-msft commented on GitHub (Mar 26, 2021): Well good, then we know this isn't specific to the Terminal! * What about `cmd.exe`, does that work? * Does `powershell --nologo -noprofile`?
Author
Owner

@mjrlgue commented on GitHub (Mar 26, 2021):

  • cmd.exe work well
  • when I type powershell --nologo -noprofile in both cmd.exe and powershell, I get this error message:
At character Line: 1: 3
+ --nologo -noprofile
+   ~
Missing expression after the unary operator « -- ».
At character Line: 1: 3
+ --nologo -noprofile
+   ~~~~~~
Unexpected "nologo" token in the expression or instruction.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingExpressionAfterOperator
@mjrlgue commented on GitHub (Mar 26, 2021): - `cmd.exe` work well - when I type `powershell --nologo -noprofile` in both `cmd.exe` and `powershell`, I get this error message: ``` At character Line: 1: 3 + --nologo -noprofile + ~ Missing expression after the unary operator « -- ». At character Line: 1: 3 + --nologo -noprofile + ~~~~~~ Unexpected "nologo" token in the expression or instruction. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MissingExpressionAfterOperator ```
Author
Owner

@mjrlgue commented on GitHub (Mar 26, 2021):

I don't know what's wrong with powershell it was working fine :(

@mjrlgue commented on GitHub (Mar 26, 2021): I don't know what's wrong with powershell it was working fine :(
Author
Owner

@zadjii-msft commented on GitHub (Mar 26, 2021):

My bad, that was a typo. Try powershell -nologo -noprofile

@zadjii-msft commented on GitHub (Mar 26, 2021): My bad, that was a typo. Try `powershell -nologo -noprofile`
Author
Owner

@mjrlgue commented on GitHub (Mar 26, 2021):

No worries, I get nothing in return in both cmd.exe and powershell

@mjrlgue commented on GitHub (Mar 26, 2021): No worries, I get nothing in return in both `cmd.exe` and `powershell`
Author
Owner

@zadjii-msft commented on GitHub (Mar 26, 2021):

Wait like, nothing at all? It should boot into powershell, like this:
image

I suppose in PowerShell's case, it'll seem like it did nothing, but it should create a new nested instance of PowerShell.

Does %USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 exist (and have any contents)? It might be under %USERPROFILE%\Documents\WindowsPowerShell, and the filename might be different - we're really just looking for any .ps1 scripts in that directory.

@zadjii-msft commented on GitHub (Mar 26, 2021): Wait like, nothing _at all_? It should boot into powershell, like this: ![image](https://user-images.githubusercontent.com/18356694/112642538-6715c400-8e11-11eb-9841-981875c8eb67.png) I suppose in PowerShell's case, it'll _seem_ like it did nothing, but it should create a new nested instance of PowerShell. Does `%USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` exist (and have any contents)? It might be under `%USERPROFILE%\Documents\WindowsPowerShell`, and the filename might be different - we're really just looking for any `.ps1` scripts in that directory.
Author
Owner

@mjrlgue commented on GitHub (Mar 26, 2021):

yes sorry it boots in powershell didn't pay attention to the PS at the beginning.
I checked %USERPROFILE%\Documents\WindowsPowerShell it's empty.
The following directory %USERPROFILE%\Documents\PowerShell contains the ps file Microsoft.PowerShell_profile.ps1 and there is two directories Modules and Scripts

@mjrlgue commented on GitHub (Mar 26, 2021): yes sorry it boots in powershell didn't pay attention to the `PS` at the beginning. I checked `%USERPROFILE%\Documents\WindowsPowerShell` it's empty. The following directory `%USERPROFILE%\Documents\PowerShell` contains the ps file `Microsoft.PowerShell_profile.ps1` and there is two directories `Modules` and `Scripts`
Author
Owner

@zadjii-msft commented on GitHub (Mar 26, 2021):

What are the contents of Microsoft.PowerShell_profile.ps1?

@zadjii-msft commented on GitHub (Mar 26, 2021): What are the contents of `Microsoft.PowerShell_profile.ps1`?
Author
Owner

@mjrlgue commented on GitHub (Mar 26, 2021):

it's an empty file

@mjrlgue commented on GitHub (Mar 26, 2021): it's an empty file
Author
Owner

@zadjii-msft commented on GitHub (Mar 26, 2021):

Huh. Is there a difference between:

  • powershell.exe -nologo
  • powershell.exe -noprofile
  • powershell.exe -nologo -noprofile

for you?

Clearly, if you're not getting the error in the third case, then there's something that those flags are disabling which is causing the error, but I don't know enough about powershell to be sure what it is.

@zadjii-msft commented on GitHub (Mar 26, 2021): Huh. Is there a difference between: * `powershell.exe -nologo` * `powershell.exe -noprofile` * `powershell.exe -nologo -noprofile` for you? Clearly, if you're not getting the error in the third case, then there's something that those flags are disabling which is causing the error, but I don't know enough about powershell to be sure what it is.
Author
Owner

@mjrlgue commented on GitHub (Mar 26, 2021):

All command executed with no error

@mjrlgue commented on GitHub (Mar 26, 2021): All command executed with no error
Author
Owner

@mjrlgue commented on GitHub (Mar 26, 2021):

I just started powershell with administrator privilege and got the following message in red:

.: File C:\Users\myUser\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because its operation is blocked by software restriction policies, such as those created by using Group Policy.
Loading personal and system profiles took 791ms.

when I start it without administrator privilege i get the message with OperationStopped: ..

@mjrlgue commented on GitHub (Mar 26, 2021): I just started powershell with administrator privilege and got the following message in red: ``` .: File C:\Users\myUser\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because its operation is blocked by software restriction policies, such as those created by using Group Policy. Loading personal and system profiles took 791ms. ``` when I start it without administrator privilege i get the message with `OperationStopped: ..`
Author
Owner

@DHowett commented on GitHub (Mar 26, 2021):

So PowerShell is taking a while to start up because your profile was blocked by the “script execution policy.” There’s a bunch of documentation about this online! 😄

@DHowett commented on GitHub (Mar 26, 2021): So PowerShell is taking a while to start up because your profile was blocked by the “script execution policy.” There’s a bunch of documentation about this online! :smile:
Author
Owner

@mjrlgue commented on GitHub (Mar 29, 2021):

yes exactly, and affecting windows terminal too. How can I resolve this? The weird thing I was modifying settings.json to customize powerline font for windows terminal ^^

@mjrlgue commented on GitHub (Mar 29, 2021): yes exactly, and affecting windows terminal too. How can I resolve this? The weird thing I was modifying `settings.json` to customize powerline font for windows terminal ^^
Author
Owner

@DHowett commented on GitHub (Mar 29, 2021):

You will need to configure your powershell script execution policy.

Unfortunately, there isn't anything Terminal can do to make this petter or worse. Sorry!

@DHowett commented on GitHub (Mar 29, 2021): You will need to configure your powershell [script execution policy](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.1). Unfortunately, there isn't anything Terminal can do to make this petter or worse. Sorry!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13188