-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Open
Labels
Area-VTVirtual Terminal sequence supportVirtual Terminal sequence supportHelp WantedWe encourage anyone to jump in on these.We encourage anyone to jump in on these.Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Priority-3A description (P3)A description (P3)Product-TerminalThe new Windows Terminal.The new Windows Terminal.Resolution-ExternalFor issues that are outside this codebaseFor issues that are outside this codebaseTracking-ExternalThis bug isn't resolved, but it's following an external workitem.This bug isn't resolved, but it's following an external workitem.
Milestone
Description
Environment
Windows build number: 10.0.19042.746
Windows Terminal version (if applicable): 1.6.10272.0
Any other software?
NeoVim: 0.4.4
Steps to reproduce
Set your cursor to 'bar' style. Open WT. Run nvim
. The cursor inside neovim is a block cursor. Exit neovim now.
Expected behavior
The cursor should turn back to bar style.
Actual behavior
The cursor remains in block style.
ianyepan, latipun7, snakesgun, alexyarovoy, djdv and 3 moreianyepan
Metadata
Metadata
Assignees
Labels
Area-VTVirtual Terminal sequence supportVirtual Terminal sequence supportHelp WantedWe encourage anyone to jump in on these.We encourage anyone to jump in on these.Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Priority-3A description (P3)A description (P3)Product-TerminalThe new Windows Terminal.The new Windows Terminal.Resolution-ExternalFor issues that are outside this codebaseFor issues that are outside this codebaseTracking-ExternalThis bug isn't resolved, but it's following an external workitem.This bug isn't resolved, but it's following an external workitem.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
zadjii-msft commentedon Feb 9, 2021
Huh, interesting. I wonder how they're changing the cursor shape. If they're doing it with the legacy APIs, then there's probably no way for them to get it back to a vertical bar. If they're using VT (which they should be), then this should work...
rashil2000 commentedon Feb 9, 2021
I don't know if it helps, but the same thing happens when I use NeoVim on WSL, or even while SSH'ing into a remote Ubuntu server.
zadjii-msft commentedon Feb 9, 2021
possibly related:
I guess none are specifically this, but they're all cursor-related
DHowett commentedon Feb 9, 2021
nvim is not restoring the cursor on exit using
DECSCUSR 0
.DHowett commentedon Feb 9, 2021
(This should be filed upstream on nvim.)
9 remaining items
rashil2000 commentedon Apr 14, 2021
I think the reason conhost is unaffected is different. It is known to reset cursor shapes on its own. I'm not aware if it's been fully fixed yet.
In my experience though, all the other terminals I mentioned in my previous comment suffer from this issue, so I'm kinda certain it's not just Windows Terminal; it has something to do with Neovim itself.
stuckinforloop commentedon Jun 26, 2021
No its not. This issue is only faced when exiting NeoVim on Windows Terminal. I have tried to do so in Alacritty and everything is working fine on Alacritty.
bartMarinissen commentedon Nov 5, 2021
I am also suffering from this problem.
It is unique to using nvim in a Windows terminal. Using the old style terminal properly restores the cursor.
When using normal vim in a windows terminal, I can get the problem fixed by adding the line:
autocmd VimLeave * silent !echo -ne "\e[0 q"
to my .vimrc.The same line in my nvim init.vim file does not work.
Tainted-Fool commentedon May 22, 2022
This cursor bug is still present for me only while using the Windows Terminal(WT). Vim changes the cursor accordingly while using cmd, powershell, and pwsh but not WT. I've deleted vimrc but the bug is still there. It seems like the setting.json file doesn't allow vim to change cursors when you switch modes. Whatever cursor you have set in WT will be the cursor for all vim modes. Does anyone got any suggestions or a work around?
j4james commentedon May 22, 2022
@Tainted-Fool What you're describing is a different issue. The Windows version of vim is probably using the
SetConsoleCursorInfo
API to alter the cursor size, but there's no equivalent VT sequence for that, so it can't be forwarded over the conpty connection to Windows Terminal. That problem is being tracked in issue #7382.jonlandrum commentedon Jul 7, 2022
I can confirm that this is not just a Windows Terminal issue, but is more likely related to Neovim itself. I am using PowerShell 7 from within wezterm, and I have the same issue.
cronyakatsuki commentedon Jan 15, 2023
This issue also happened to me with programs like newsboat through wsl where the cursor would become invisible.
awa5114 commentedon Apr 9, 2023
I am facing this issue with Windows Terminal. The issue does not occur when using
cmd
or a regular powershell terminal. So I believe it's more of a Windows Terminal issue than annvim
issue.guru245 commentedon May 11, 2025
I can show you a workaround.
Add this setting to your neovim init.lua.
vim.o.guicursor = ''
Warning
Mind that it is not a double quote, but two single quotes.