Write-Host -NoNewLine "e[2 q"` line to disable cursor blinkvim should not change the cursor behavior
9.0.1194
Operating system: windows 11
Terminal: windows terminal
Shell: Powershell 7.2.8
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
There is a chance that this was fixed in patch 9.0.1252 - that fixed a bug how Vim restores the MS-Windows console buffer on exit - it would impact the new windows terminal as well as the old command console.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Ah, hang on - something else I remember,
Vim does change the cursor shape - that is by design.
But, you can configure it how you like - for example in my .vimrc file;
This works on windows terminal;
augroup CursorSettings
autocmd!
" Alternative codes:
" 1 -> blinking block
" 2 -> solid block
" 3 -> blinking underscore
" 4 -> solid underscore
" 5 -> blinking vertical bar
" 6 -> solid vertical bar
autocmd VimEnter * let &t_SI.="\e[5 q" "SI = INSERT mode
autocmd VimEnter * let &t_SR.="\e[4 q" "SR = REPLACE mode
autocmd VimEnter * let &t_EI.="\e[2 q" "EI = NORMAL mode (ELSE)
autocmd VimLeave * let &t_EI.="\e[6 q" | normal i
augroup END
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
You can change the VimLeave line, to match your custom terminal cursor style.
autocmd VimLeave * let &t_EI.="\e[2 q" | normal i
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
There is a chance that this was fixed in patch 9.0.1252 - that fixed a bug how Vim restores the MS-Windows console buffer on exit - it would impact the new windows terminal as well as the old command console.
Ah, that's pretty nice,thank you very much.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Ah, hang on - something else I remember, Vim does change the cursor shape - that is by design. But, you can configure it how you like - for example in my .vimrc file;
This works on windows terminal;
augroup CursorSettings autocmd! " Alternative codes: " 1 -> blinking block " 2 -> solid block " 3 -> blinking underscore " 4 -> solid underscore " 5 -> blinking vertical bar " 6 -> solid vertical bar autocmd VimEnter * let &t_SI.="\e[5 q" "SI = INSERT mode autocmd VimEnter * let &t_SR.="\e[4 q" "SR = REPLACE mode autocmd VimEnter * let &t_EI.="\e[2 q" "EI = NORMAL mode (ELSE) autocmd VimLeave * let &t_EI.="\e[6 q" | normal i augroup END
I tried but failed with some mistakes which i haven't figured out, i will retest my config, Thank you~~
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
See also :help termcap-cursor-shape:
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
About this bit -
NOTE: When Vim exits the shape for Normal mode will remain. The shape from before Vim started will not be restored.
I found it's possible to hook into the VimLeave auto-command, and make it switch the cursor back to the insert mode cursor at the end:
autocmd VimLeave * let &t_SI.="\e[6 q" | normal i
Maybe I've been relying on an undocumented "feature", but I found I could get it to set the insert mode cursor on exit. The | normal i bit achieves that.
I'm assuming this is still the case. I just realised that the stuff before the | may be completely redundant, I can't recall now why I did it like that. Anyway, I was able to get the insert mode cursor restored to the console again on exit.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
arghh, I'm just testing all this now on latest release of Windows 11 (22H2).
It's not behaving the same anymore like it was when I first set it up on windows 10 - that was maybe two or three years ago.
So, I'm investigating further. Its all a bit strange. I'm getting underscore when I set to block, I'm getting block when I set to bar etc. It's really weird at the moment.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I haven't looked into this yet, but v9.0.0347 might be related.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Related, but OK I think.
I cleaned out my vimrc, trying to keep things simple - and it looks like it still works OK - if I just do a minimal set like this;
let &t_SI.="\e[5 q" "t_SI = Start INSERT mode
let &t_SR.="\e[4 q" "t_SR = Start REPLACE mode
let &t_EI.="\e[2 q" "t_EI = End Insert mode - usually starts NORMAL mode
let &t_te.="\e[0 q" "t_te = Termcap End - usually called when exiting Vim.
and when I just have that (without the auto-command) - it seems to work OK. The termcap end (t_te) seems to be a new trick that I didn't know about before when I first set all this up in my environment - t_te is so much cleaner than hooking into VimLeave. Also, it seems that "\e[0 q" is working now properly. That was confusing me. But, I think it's actually better the way it is now.
I suggest that the only line @clor09 needs (to achieve their initial expected outcome as written) is just this one line in the vimrc;
let &t_te.="\e[0 q"
I'm assuming @clor09 is on Win 11 release 22H2
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
FYI - Reference: https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#cursor-shape
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I found the cause of my confusion. I must have moved things around in my vimrc, some time ago, and somehow had set termguicolors after setting the cursor settings.
@clor09
Note, in the vimrc file, all these cursor settings must come down after setting up the colorscheme and termguicolors (if you set them.)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Ah, hang on - something else I remember, Vim does change the cursor shape - that is by design. But, you can configure it how you like - for example in my .vimrc file;
This works on windows terminal;
augroup CursorSettings autocmd! " Alternative codes: " 1 -> blinking block " 2 -> solid block " 3 -> blinking underscore " 4 -> solid underscore " 5 -> blinking vertical bar " 6 -> solid vertical bar autocmd VimEnter * let &t_SI.="\e[5 q" "SI = INSERT mode autocmd VimEnter * let &t_SR.="\e[4 q" "SR = REPLACE mode autocmd VimEnter * let &t_EI.="\e[2 q" "EI = NORMAL mode (ELSE) autocmd VimLeave * let &t_EI.="\e[6 q" | normal i augroup END
thank you so much
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()