-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 Cursor shape stays underscore. Not able to change it #68
Comments
From @parkovski on January 10, 2018 21:27 I don't think this is possible right now - the console needs to understand a cursor escape, like Edit - there may be a hacky way to do this right now. You can write a small Windows C program that calls |
Any updates on this? It is required for good out-of-the-box experience with vim/nvim. |
Oh yea! I added support for cursor shapes, colors for RS5. If vim's using them to set the shape, then they should work. It's on it's way to Insiders now :) |
Wow the command prompt team keeps delivering time and time again. What a time to be alive! Thanks for all the great work. |
@p-groarke Thanks for the kind words, but please stop being nice to our dev's - it makes them all happy and distracts them from their long list of bugs & features. Back to your keyboard @zadjii-msft or I'll have to put you on notice again ;) |
lol! |
Any update? really need vertical bar and block cursor to work with vim, I can't distinguish I'm in normal mode or insert mode. @zadjii-msft and give me your $PS1 :D |
@tuyenpm9 that's no $PS1, that's a %PROMPT% setting in CMD: Also, I'm certain support for this is in Insider's (at the very least). How are you setting your cursor shape in vim? I know that this method works at the very least: http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes#For_Terminal_on_macOS
|
I use default cursor shape in vim. I don't know what kind of terminal when running Non-related question: I got this error when trying to run
|
@tuyenpm9 What build of Windows are you running? The "terminal" you get when you run a commandline application on Windows is conhost.exe. It's definitely not listed on that page, but I can assure you that adding those lines to your .vimrc should work on insider's builds: (the cursor is on line 5) Are you sure that you copied the entire file? |
Windows or Linux vim? I’ve found those cursor codes work in Linux vim (WSL) but not Windows. Not sure why. Neovim on Windows does support it but you have to use |
@parkovski : This is terminal vim. @zadjii-msft : I use version 1709 build 16299.611, probably not insider version. I clone |
@tuyenpm9 I don't recall when exactly I added support for cursor shapes, but I believe it was 1803. It was definitely after 1709. I'd try upgrading, that'll probably light this up for you. I opened zadjii/keep#1 to track your issues with |
@tuyenpm9 - Should have been clearer, sorry. All non-terminal versions (gvim) support this via Anyways, I don't think my question is relevant anymore due to your build number. |
It would help to know which Windows build this was fixed in. I am on Windows 10 version 1803 build number 17134.320 and I still have the issue. |
That might by my mistake - looks like it actually wasn't merged in finally until after the cutoff for 1803, so it's not actually in 1803. I can't be sure which is the actual build number with it enabled, but it's definitely after 17134. |
I can confirm that this fix was included in Windows 10 version 1809 (Build 17763.194). |
This is I suppose tangental to the issue, but I really want the cursor to change in vim. I don’t know how to get 1809. I'm on 1803 (17134.556), and there is no update available. I tried doing that insiders program, but after doing the link my account go get started, it just does a little spin, then my account never gets added. Maybe because it's an azure vm and/or the account is an alias(at)microsoft.com there is some restriction? (sorry I have no real idea how to use windows, which is why I'm clinging to vim and wsl as much as I can ;) ) |
I can not observe this issue is fixed. I am on Windows 10 18362, Terminal v. 0.5.2762 , PS Core 7 (Preview) Thanks for the great work though! |
I've never been able to get the cursor change working in vim.exe and I don't know why. I mostly use neovim, and it does work there, so I think this is a vim issue now. Edit - just experimented a bit, it sort of works this way, but the screen gets glitchy for me:
|
I am on the latest version of windows (1909). I tried all the methods mentioned above on vim in WSL. Nothing works for me :/ |
Got block/bar cursor working in powershell, cmd, and wsl with :
Note spaces before the control sequence in the win32 terminal configuration. Microsoft Windows [Version 10.0.18362.657] 1903 WSL - Ubuntu 18.04.4 LTS |
Thanks for this, but somehow, it doesn't work when |
Nothing is work for windows terminal vim. |
EDIT 2: Ok, this wasn't a windows terminal issue. If it helps anyone, there were two things that stopped it working:
|
Also can add |
I thought I'd add to this because this turns up in the google results, and I've tried every combination. What finally worked for me was let &t_SI="\<CSI>5\ q"
let &t_SR="\<CSI>7\ q"
let &t_EI="\<CSI>2\ q" There's still an issue where the single character replace mode glitches out, but this fixed a lot of the visual bugs I had with other versions of this. |
There is also a psychological hack: at first, the underscore cursor looks very annoying and unnatural, but after a month of usage you will be absolutely comfortable with it and even won't notice a switch between the underscore cursor and the standard block cursor when working in other environments. At least this is what happened to me. |
Sure but not being able to distinguish between insert and command mode is annoying |
In my case it defaulted to either vertical bar or blinking block, both of which are unacceptable. |
The default cursor for the terminal is easily configurable in settings. Just change the cursorShape for the profile you're using. |
This saved the day for me, but there was a quirk with leaving Insert mode and keeping a vertical bar instead of a block cursor for about a second. Following this advice, adding |
Yes, I also noticed this glitch -- when
Big downside to What worked better for me was to use the
I suggest trying values of 250, 50, or 5 to balance* your computer/network speed with your preference for responsiveness. *To explain a bit more about this balancing act: setting lower values will make pressing escape look and feel more responsive, but on slow computers or slow networks, setting the value too low may interfere with your ability to use control keys (like arrow keys) while in non-normal modes in vim. If you're feeling conservative, just pick something like 250 and deal with the small big of sluggishness. If you're feeling adventurous, keep setting the value lower and lower until it breaks, then back off. :) |
The given solutions work great, but unfortunately introduces major visual glitches when |
Update: My strange solution is broken/not necessary now (don't know since when). The following works when sourced, but not when autoloaded as vimrc. I have no idea what's going on. let &t_SI=" \e[5 q"
let &t_SR=" \e[4 q"
let &t_EI=" \e[2 q"
let &t_ti=" \e[S \e[2 q"
let &t_te=" \e[E \e[1 q" (I still see the visual bug for |
By win32 So the workaround for win32 vim is to build a c library do the job.
|
Nvm, that works perfectly, I just had to revert some changes I had to make to make it work on my development computer ... |
From @ponegan on January 9, 2018 6:40
Your Windows build number: (Type
ver
at a Windows Command Prompt)Microsoft Windows [Version 10.0.16299.125]
What you're doing and what's happening / What's wrong / what should be happening instead:
I'm using xterm-256color.
I had been tried to change the shape of my vim cursor. I tried lots of different configuration for cursor shape (to be block) but none of them works as I put them in my .vimrc.
For example I tried some of these:
http://vim.wikia.com/wiki/Configuring_the_cursor
In the terminal I was able to change the shape of cursor to block by selecting 'large' in property as @zadjii-msft suggested in #1253. But the same trick won't work for vim. Well.... it will work at the moment I set it to 'large'. But it will reset back to underscore every time I open another file.
As this:
Anyone got a good approach on this cursor configuration?
Copied from original issue: microsoft/WSL#2821
The text was updated successfully, but these errors were encountered: