-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vim cursror is always set to the one of Windows Terminal #8560
Comments
WHAT VERSION OF VIM are you using. You didn't list "any other software", which is part of the template, so we can't even tell if you're using Windows vim or Linux vim in WSL. |
I updated the issue |
Are you using windows vim.exe or vim inside wsl. |
Facing the same issue |
I'm not sure that this is a WT issue. The shape of the cursor is configured in vim, and by default will not change when switching modes (that I am aware of). Additionally, make sure that your vim version includes the +cursorshape feature ( let &t_SI.="\e[5 q"
let &t_SR.="\e[4 q"
let &t_EI.="\e41 q" For more info on this, see Note: Neovim does by default change the cursor, and the options above will work, but are not the recommended way. In Neovim, see |
This is what I had to add to my .vimrc to make the cursor function as expected in WT. |
I see the same behavior on WT with Powershell 7. If it's not a problem with WT, then why does vim's cursor work as expected even in the windows console (cmd.exe and powershell.exe)? Would be great to see this fixed since I cannot use WT if vim doesn't work there just like it works everywhere else. Who would? Similar problem exists in WT when using Set-PSReadLine to vi. WT is the "only one" who requires a cursor change handler to be set via Set-PSReadLine. Everyone else "just works". |
I could've swore we had a dupe for this laying around. I'm pretty sure apps that change the cursor size using the Win32 API won't have those changes mirrored to the Terminal. Apps that set the cursor shape with VT sequences should work just fine.
So if you're using Win32 possibly related:
Actually after re-reading that I think this is /dup #7382 |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Vimscripts provided by @willeccles and @lemonnuggets work poorly on pwsh in WT. It's also not clear why their scripts differ from each other's. Their examples also break the already-working cursor on the regular windows console when running vim from cmd.exe or pwsh.exe. Powershell's Set-PSReadLineOption also doesn't work the same way between windows console and WT, and when used in combination with the vimscripts mentioned, there more problems ensue. In windows console, it's sufficient to call Cursor guidance for vim on different terminals can be found here Would it be possible to update that listing with similar guidance for WT that has actually been tested with the different shells that WT supports, and, if necessary, when used in combination with Set-PSReadLineOption? At least in the meantime until the WT team has figured out if WT can be "fixed" so that vim works consistently on WT and the windows console? |
The escape sequences will not work in cmd.exe or pwsh.exe if they do not support them. Windows Terminal seems to, and I've had no issue using that setup for years now on numerous terminals (including WT). The other user's script only differs from mine in that it's harder to read and achieves slightly different cursor configurations. I will note that I have used vim.exe for a total of maybe an hour in my life, and these days I only use vim through WSL on WT. As far as I'm aware, WT should have no issues with these escape sequences. |
As I said, for me they aren't working in vim in pwsh in WT. As you said, you are using it in WSL, I haven't tried there. I'm talking vim.exe in pwsh in WT on Win10. |
@zadjii-msft's comment implies to me that it should work, though it's possible that updates to WT have broken it as well. Also, make sure you have |
Yes, I am compiled with |
Side subject here, anyone knows the terminal escape sequence for the openBox cursor? That would make me very happy and be an easy solution. I also have the same issue as well with neovim .05 and .06. Replicated the issue in Windows terminal with wsl and ubuntu:focal in docker. I tried the below with other cursor shapes as well same thing. My zshrc and init.vim are empty. I am pretty sure it's an issue with NEOVIM in my case. |
There's not a standard sequence for that, but there was a discussion in issue #7382 about potentially extending the |
The cursor in Vim doesn't change and the solutions provided in issue 4335 don't work.
Environment
Steps to reproduce
Install Vim and switch from normal to insert mode. The cursor always stays the same. You can set the cursor in the Windows Terminal settings .json, but it will not change in Vim.
Expected behavior
The cursor should change when switching modes in Vim
Actual behavior
It doesn't change
The text was updated successfully, but these errors were encountered: