Cursor does not blink in WSL and after leaving it too. #17805

Closed
opened 2026-01-31 05:53:57 +00:00 by claunia · 19 comments
Owner

Originally created by @Anutrix on GitHub (Jun 25, 2022).

Windows Terminal version

1.13.11432.0

Windows build number

10.0.22000.0

Other Software

WSL2 as Kali GNU/Linux Rolling on Windows 10 x86_64:
image

Steps to reproduce

  1. Open Windows Terminal by any means like Win+X shortcut menu. Notice cursor is blinking.
  2. Type kali or your WSL system name to start it.
  3. Notice that cursor does not blink.
  4. Type exit to exit WSL shell to return to normal PowerShell on the terminal.
  5. Notice that it's not blinking even here now.

Only way after this is to start a new terminal tab or window.

Expected Behavior

Cursor should blink even in a WSL and also after leaving it.

Actual Behavior

Cursor does not blink in WSL and also after leaving it.

Originally created by @Anutrix on GitHub (Jun 25, 2022). ### Windows Terminal version 1.13.11432.0 ### Windows build number 10.0.22000.0 ### Other Software WSL2 as Kali GNU/Linux Rolling on Windows 10 x86_64: ![image](https://user-images.githubusercontent.com/11459028/175801698-0b97c9c1-d692-47c6-9758-b431f34f0303.png) ### Steps to reproduce 1. Open Windows Terminal by any means like Win+X shortcut menu. Notice cursor is blinking. 2. Type `kali` or your WSL system name to start it. 3. Notice that cursor does not blink. 4. Type `exit` to exit WSL shell to return to normal PowerShell on the terminal. 5. Notice that it's not blinking even here now. Only way after this is to start a new terminal tab or window. ### Expected Behavior Cursor should blink even in a WSL and also after leaving it. ### Actual Behavior Cursor does not blink in WSL and also after leaving it.
claunia added the Needs-TriageIssue-BugNeeds-Tag-Fix labels 2026-01-31 05:53:58 +00:00
Author
Owner

@aradalvand commented on GitHub (Jun 25, 2022):

Here's a recorded video of my screen demonstrating this:

https://user-images.githubusercontent.com/26527405/175792518-8e3d54a3-638d-4c0d-91f2-50d7b22fadf6.mp4

Might be helpful.

@aradalvand commented on GitHub (Jun 25, 2022): Here's a recorded video of my screen demonstrating this: https://user-images.githubusercontent.com/26527405/175792518-8e3d54a3-638d-4c0d-91f2-50d7b22fadf6.mp4 Might be helpful.
Author
Owner

@dkter commented on GitHub (Jun 26, 2022):

Does the cursor blink if you start WSL in another terminal other than WT?

If not, it might be an issue with your shell in WSL. There's an escape sequence that turns cursor blinking off; it may be that your shell config is sending that escape sequence.

@dkter commented on GitHub (Jun 26, 2022): Does the cursor blink if you start WSL in another terminal other than WT? If not, it might be an issue with your shell in WSL. There's an escape sequence that turns cursor blinking off; it may be that your shell config is sending that escape sequence.
Author
Owner

@Anutrix commented on GitHub (Jun 26, 2022):

Does the cursor blink if you start WSL in another terminal other than WT?

If not, it might be an issue with your shell in WSL. There's an escape sequence that turns cursor blinking off; it may be that your shell config is sending that escape sequence.

Nope. Not a WSL issue as issue persists even after exiting WSL in the tab that had WSL. Even if it was causing issue when using WSL shell, leaving it and going back to PS should undo it.

Also, tested WSL shell in Cmder[https://github.com/cmderdev/cmder] based on ConEmu. Works perfectly. So most probably Windows Terminal issue.

@Anutrix commented on GitHub (Jun 26, 2022): > Does the cursor blink if you start WSL in another terminal other than WT? > > If not, it might be an issue with your shell in WSL. There's an escape sequence that turns cursor blinking off; it may be that your shell config is sending that escape sequence. Nope. Not a WSL issue as issue persists even after exiting WSL in the tab that had WSL. Even if it was causing issue when using WSL shell, leaving it and going back to PS should undo it. Also, tested WSL shell in [Cmder](https://cmder.net/)[https://github.com/cmderdev/cmder] based on [ConEmu](https://conemu.github.io/). Works perfectly. So most probably Windows Terminal issue.
Author
Owner

@j4james commented on GitHub (Jun 26, 2022):

Not a WSL issue as issue persists even after exiting WSL in the tab that had WSL. Even if it was causing issue when using WSL shell, leaving it and going back to PS should undo it.

As far as I'm aware, there is no terminal state that is automatically reset when returning from WSL to PowerShell. So if you've turned off the cursor blinking in WSL, it's expected to remain turned off when you exit back to PS.

Also, tested WSL shell in Cmder[https://github.com/cmderdev/cmder] based on ConEmu. Works perfectly. So most probably Windows Terminal issue.

If you've got a script that's turning off the cursor blink, it's probably doing so with private mode 12 which ConEmu doesn't support. So again it wouldn't be surprising that you're not seeing the same issue in Cmder.

In any event, if you want to try turning the cursor blink back on manually, you can do so in PowerShell with:

echo `e[?12h

And in a WSL shell with:

printf "\e[?12h"

If that works, I'd suggest looking at your shell config, as @dkter suggested, to see if there is something there that is forcing the cursor blink off.

@j4james commented on GitHub (Jun 26, 2022): > Not a WSL issue as issue persists even after exiting WSL in the tab that had WSL. Even if it was causing issue when using WSL shell, leaving it and going back to PS should undo it. As far as I'm aware, there is no terminal state that is automatically reset when returning from WSL to PowerShell. So if you've turned off the cursor blinking in WSL, it's expected to remain turned off when you exit back to PS. > Also, tested WSL shell in [Cmder](https://cmder.net/)[https://github.com/cmderdev/cmder] based on [ConEmu](https://conemu.github.io/). Works perfectly. So most probably Windows Terminal issue. If you've got a script that's turning off the cursor blink, it's probably doing so with private mode 12 which ConEmu doesn't support. So again it wouldn't be surprising that you're not seeing the same issue in Cmder. In any event, if you want to try turning the cursor blink back on manually, you can do so in PowerShell with: echo `e[?12h And in a WSL shell with: printf "\e[?12h" If that works, I'd suggest looking at your shell config, as @dkter suggested, to see if there is something there that is forcing the cursor blink off.
Author
Owner

@aradalvand commented on GitHub (Jun 26, 2022):

Does the cursor blink if you start WSL in another terminal other than WT?

@dkter Yes, it does. Here is the default "Ubuntu" terminal:

https://user-images.githubusercontent.com/26527405/175810405-1c60f2cc-82f7-44bb-9b0d-e89d14148619.mp4

So, I think tbis confirms there must be something wrong with Windows Terminal.

@aradalvand commented on GitHub (Jun 26, 2022): > Does the cursor blink if you start WSL in another terminal other than WT? @dkter Yes, it does. Here is the default "Ubuntu" terminal: https://user-images.githubusercontent.com/26527405/175810405-1c60f2cc-82f7-44bb-9b0d-e89d14148619.mp4 So, I think tbis confirms there must be something wrong with Windows Terminal.
Author
Owner

@aradalvand commented on GitHub (Jun 26, 2022):

Just to be clear, at least in my case, this problem doesn't arise consistently, it just seems that the cursor "sometimes" stops blinking for some reason. Usually when I create a new tab I notice that the blinking in the new tab is normal:

https://user-images.githubusercontent.com/26527405/175812287-753ad62a-e50d-4b43-983c-e9f1ab71a75b.mp4

@aradalvand commented on GitHub (Jun 26, 2022): Just to be clear, at least in my case, this problem doesn't arise consistently, it just seems that the cursor "sometimes" stops blinking for some reason. Usually when I create a new tab I notice that the blinking in the new tab is normal: https://user-images.githubusercontent.com/26527405/175812287-753ad62a-e50d-4b43-983c-e9f1ab71a75b.mp4
Author
Owner

@lhecker commented on GitHub (Jun 27, 2022):

Hmm, unfortunately I can't reproduce this issue with my WSL setup at all (1.13.11432.0). Can anyone else reproduce the issue who'd be willing/capable of debugging this?

Just to be sure:

> wsl --version
WSL version: 0.60.0.0
Kernel version: 5.10.102.1
WSLg version: 1.0.34
MSRDC version: 1.2.2924
Direct3D version: 1.601.0
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22813.1000
@lhecker commented on GitHub (Jun 27, 2022): Hmm, unfortunately I can't reproduce this issue with my WSL setup _at all_ (1.13.11432.0). Can anyone else reproduce the issue who'd be willing/capable of debugging this? Just to be sure: ``` > wsl --version WSL version: 0.60.0.0 Kernel version: 5.10.102.1 WSLg version: 1.0.34 MSRDC version: 1.2.2924 Direct3D version: 1.601.0 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22813.1000 ```
Author
Owner

@allysonreeis commented on GitHub (Jul 7, 2022):

For me it just blink if I type printf "\e[?12h". When I open the PowerShell the cursor works well, but when I open Ubuntu WSL it doesn't work, so I need to run this command

@allysonreeis commented on GitHub (Jul 7, 2022): For me it just blink if I type printf "\e[?12h". When I open the PowerShell the cursor works well, but when I open Ubuntu WSL it doesn't work, so I need to run this command
Author
Owner

@j4james commented on GitHub (Jul 7, 2022):

when I open Ubuntu WSL it doesn't work

As explained above, this is likely because you've got something in your shell config that is turning the blinking off.

@j4james commented on GitHub (Jul 7, 2022): > when I open Ubuntu WSL it doesn't work As explained above, this is likely because you've got something in your shell config that is turning the blinking off.
Author
Owner

@Anutrix commented on GitHub (Jul 10, 2022):

I use oh-my-zsh and powerlevel10k. That's pretty much the only thing in my shell config. Would like to know what others with the same issue use.

Update: https://github.com/romkatv/powerlevel10k/issues/1699 is connected.
Owner of that repo seems to say it's because of the Terminal.
Since it only happens on WSL on Terminal and not any other normal OS with same config.

@Anutrix commented on GitHub (Jul 10, 2022): I use `oh-my-zsh` and `powerlevel10k`. That's pretty much the only thing in my shell config. Would like to know what others with the same issue use. Update: https://github.com/romkatv/powerlevel10k/issues/1699 is connected. Owner of that repo seems to say it's because of the Terminal. Since it only happens on WSL on Terminal and not any other normal OS with same config.
Author
Owner

@j4james commented on GitHub (Jul 10, 2022):

@Anutrix Thanks for those details. I can reproduce the issue with that config. But as far as I can see, it is in fact the powerlevel0k theme that is disabling the cursor blinking.

If you take a look at the code in pt0k.zsh, you'll see a number of references to cnorm, for example here:
0c197ed4a5/internal/p10k.zsh (L7659)

As explained in the ncurses FAQ, there are three cursor capabilities:

  • civis - makes the cursor invisible
  • cnorm - makes the cursor appear normal
  • cvvis - makes the cursor very visible

"Very visible" generally means the cursor is blinking, and "normal" generally means it isn't blinking. For example, if you look at the terminfo for xterm-256color, you'll see cnorm defined as \E[?12l\E[?25h. That disables private mode 12 (which disables the blinking), and enables private mode 25 (which makes the cursor visible).

The bottom line is that whenever p10k executes echoti cnorm, it's disabling the cursor blinking.

@j4james commented on GitHub (Jul 10, 2022): @Anutrix Thanks for those details. I can reproduce the issue with that config. But as far as I can see, it is in fact the *powerlevel0k* theme that is disabling the cursor blinking. If you take a look at the code in [pt0k.zsh](https://github.com/romkatv/powerlevel10k/blob/0c197ed4a51e10ed613e48a080f23b1ee7968006/internal/p10k.zsh), you'll see a number of references to `cnorm`, for example here: https://github.com/romkatv/powerlevel10k/blob/0c197ed4a51e10ed613e48a080f23b1ee7968006/internal/p10k.zsh#L7659 As explained in the [ncurses FAQ](https://invisible-island.net/ncurses/ncurses.faq.html#emacs_cvvis-id), there are three cursor capabilities: * `civis` - makes the cursor invisible * `cnorm` - makes the cursor appear normal * `cvvis` - makes the cursor very visible "Very visible" generally means the cursor is blinking, and "normal" generally means it isn't blinking. For example, if you look at the terminfo for `xterm-256color`, you'll see `cnorm` defined as `\E[?12l\E[?25h`. That disables private mode 12 (which disables the blinking), and enables private mode 25 (which makes the cursor visible). The bottom line is that whenever p10k executes `echoti cnorm`, it's disabling the cursor blinking.
Author
Owner

@j4james commented on GitHub (Jul 21, 2022):

FYI, powerlevel10k has committed an update that avoids using cnorm where possible, so it shouldn't effect the cursor blinking in Windows Terminal anymore.

@j4james commented on GitHub (Jul 21, 2022): FYI, _powerlevel10k_ has committed an [update](https://github.com/romkatv/powerlevel10k/commit/e72264e01cb24431455ed6e398a769bca0da7ffe) that avoids using `cnorm` where possible, so it shouldn't effect the cursor blinking in Windows Terminal anymore.
Author
Owner

@Anutrix commented on GitHub (Jul 24, 2022):

FYI, powerlevel10k has committed an update that avoids using cnorm where possible, so it shouldn't effect the cursor blinking in Windows Terminal anymore.

Confirmed that it works fine on WSL2 on Windows Terminal after updating powerlevel10k.

@Anutrix commented on GitHub (Jul 24, 2022): > FYI, _powerlevel10k_ has committed an [update](https://github.com/romkatv/powerlevel10k/commit/e72264e01cb24431455ed6e398a769bca0da7ffe) that avoids using `cnorm` where possible, so it shouldn't effect the cursor blinking in Windows Terminal anymore. Confirmed that it works fine on WSL2 on Windows Terminal after updating `powerlevel10k`.
Author
Owner

@Anutrix commented on GitHub (Jul 24, 2022):

Powerlevel10k e72264e01c seems to be the version with the fix.
Closing as fixed.

Do comment if it's still broken for anyone.

@Anutrix commented on GitHub (Jul 24, 2022): Powerlevel10k https://github.com/romkatv/powerlevel10k/commit/e72264e01cb24431455ed6e398a769bca0da7ffe seems to be the version with the fix. Closing as fixed. Do comment if it's still broken for anyone.
Author
Owner

@Banger commented on GitHub (Nov 16, 2023):

Broken for me. Ubuntu 20.04 in WSL2. I also tested with a fresh install on a new computer, did the same.

It works at first and as long as I stay in the shell (bash), but once I open anything that uses curses, it stops flashing. I saw it first with tmux, but also tested with vi, top, htop.

It might be related to the gibberish that comes out on first starting tmux since one of the Windows updates and/or Linux updates (I updated both at the same time, I'm not sure which really caused it):

^[[?61;6;7;22;23;24;28;32;42c[16:36:31][:user/]$ 61;6;7;22;23;24;28;32;42c

I can get the flashing back with printf "\e[?12h" once I get back to the shell. But it's not a solution!

@Banger commented on GitHub (Nov 16, 2023): Broken for me. Ubuntu 20.04 in WSL2. I also tested with a fresh install on a new computer, did the same. It works at first and as long as I stay in the shell (bash), but once I open anything that uses curses, it stops flashing. I saw it first with `tmux`, but also tested with `vi`, `top`, `htop`. It might be related to the gibberish that comes out on first starting `tmux` since one of the Windows updates and/or Linux updates (I updated both at the same time, I'm not sure which really caused it): ``` ^[[?61;6;7;22;23;24;28;32;42c[16:36:31][:user/]$ 61;6;7;22;23;24;28;32;42c ``` I can get the flashing back with `printf "\e[?12h"` once I get back to the shell. But it's not a solution!
Author
Owner

@mschaufelberger commented on GitHub (Apr 20, 2024):

Still broken and reproducible here. Windows Terminal 1.19.10821.0, Ubuntu 22.04.3 LTS.

Windows Terminal App (WindowsTerminal.exe):

  1. Cursor blinks
  2. Open nano -> cursor does NOT blink here
  3. Exit nano -> cursor keeps NOT blinking

NB: It's the same behavior with either profile:

  • "Ubuntu-22.04" (wsl.exe with the Linux penguin icon)
  • "Ubuntu 22.04.3 LTS" (ubuntu2204.exe with the Ubuntu icon)

Using the above mentioned Apps directly (same behavior for wsl.exe and ubuntu2204.exe):

  1. Cursor blinks
  2. Open nano -> cursor does NOT blink here
  3. Exit nano -> cursor blinks again

Using mintty 3.7.0 (mintty.exe from Git, starting the same WSL bash.exe as with the other terminals)

  1. Cursor blinks
  2. Open nano -> cursor blinks here (!)
  3. Exit nano -> cursor still blinks (always has been)

As mentioned by @Banger, there is the exact same behavior when opening vim, htop or tmux instead of nano in my examples above.

So it's clearly a Windows Terminal issue, with wsl.exe and ubuntu2204.exe having a slightly less severe version of the issue.

@mschaufelberger commented on GitHub (Apr 20, 2024): **Still broken and reproducible** here. Windows Terminal 1.19.10821.0, Ubuntu 22.04.3 LTS. _Windows Terminal_ App (_WindowsTerminal.exe_): 1. Cursor blinks 2. Open `nano` -> cursor does NOT blink here 3. Exit `nano` -> cursor keeps NOT blinking NB: It's the same behavior with either profile: * "Ubuntu-22.04" (_wsl.exe_ with the Linux penguin icon) * "Ubuntu 22.04.3 LTS" (_ubuntu2204.exe_ with the Ubuntu icon) Using the above mentioned Apps directly (same behavior for _wsl.exe_ and _ubuntu2204.exe_): 1. Cursor blinks 2. Open `nano` -> cursor does NOT blink here 3. Exit `nano` -> cursor blinks again Using mintty 3.7.0 (_mintty.exe_ from Git, starting the same WSL bash.exe as with the other terminals) 1. Cursor blinks 2. Open `nano` -> cursor blinks here (!) 3. Exit `nano` -> cursor still blinks (always has been) As mentioned by @Banger, there is the exact same behavior when opening `vim`, `htop` or `tmux` instead of `nano` in my examples above. So it's clearly a _Windows Terminal_ issue, with _wsl.exe_ and _ubuntu2204.exe_ having a slightly less severe version of the issue.
Author
Owner

@alexhausen commented on GitHub (Jun 19, 2024):

The issue is not exclusive to WSL or Ubuntu apps.

It can be reproduced with Git bash.

Windows Terminal version: 1.20.11381.0

  • Open a new Windows Terminal tab for Git bash: C:\Program Files\Git\bin\bash.exe -i -l
  1. Cursor blinks
  2. Open nano -> cursor stops blinking
  3. Exit nano -> cursor still doesn't blink

  • Compared when opening Git bash without Windows Terminal (which is a mingw64 app)
  1. Cursor blinks
  2. Open nano -> cursor keeps blinking
  3. Exit nano -> cursor still blinks

As mentioned by others, the same behavior is also observed with other terminal apps.

@alexhausen commented on GitHub (Jun 19, 2024): The issue is not exclusive to WSL or Ubuntu apps. It can be reproduced with Git bash. Windows Terminal version: 1.20.11381.0 - Open a new Windows Terminal tab for Git bash: `C:\Program Files\Git\bin\bash.exe -i -l` 1. Cursor blinks 2. Open `nano` -> cursor stops blinking 3. Exit `nano` -> cursor still doesn't blink --- - Compared when opening Git bash without Windows Terminal (which is a mingw64 app) 1. Cursor blinks 2. Open `nano` -> cursor keeps blinking 3. Exit `nano` -> cursor still blinks As mentioned by others, the same behavior is also observed with other terminal apps.
Author
Owner

@hwc-tuhu commented on GitHub (Jul 16, 2024):

@Anutrix @j4james seems this issue should be reopened

@hwc-tuhu commented on GitHub (Jul 16, 2024): @Anutrix @j4james seems this issue should be reopened
Author
Owner

@j4james commented on GitHub (Jul 16, 2024):

@hwc-tuhu You can follow issue #10754 - it's essentially the same thing. But I think the only way that Windows Terminal can "fix" this would be with an option to ignore the blinking escape sequence, similar to mintty.

@j4james commented on GitHub (Jul 16, 2024): @hwc-tuhu You can follow issue #10754 - it's essentially the same thing. But I think the only way that Windows Terminal can "fix" this would be with an option to ignore the blinking escape sequence, similar to mintty.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17805