terminal: Cursor does not blink in WSL and after leaving it too.
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:

Steps to reproduce
- Open Windows Terminal by any means like Win+X shortcut menu. Notice cursor is blinking.
- Type
kalior your WSL system name to start it. - Notice that cursor does not blink.
- Type
exitto exit WSL shell to return to normal PowerShell on the terminal. - 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.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 16 (2 by maintainers)
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.
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:
And in a WSL shell with:
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.
@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: https://github.com/romkatv/powerlevel10k/blob/0c197ed4a51e10ed613e48a080f23b1ee7968006/internal/p10k.zsh#L7659As explained in the ncurses FAQ, there are three cursor capabilities:
civis- makes the cursor invisiblecnorm- makes the cursor appear normalcvvis- 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 seecnormdefined 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.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.
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 withvi,top,htop.It might be related to the gibberish that comes out on first starting
tmuxsince one of the Windows updates and/or Linux updates (I updated both at the same time, I’m not sure which really caused it):I can get the flashing back with
printf "\e[?12h"once I get back to the shell. But it’s not a solution!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.