On the terminal itself the cursor works fine and changes to BLOCK shape to VLINE shape but inside VIM its simple does not work.
Follow my configuration for the cursor shape on my .zshrc file:
vicmd) print -n -- "\E]50;CursorShape=0\C-G";; # block cursor
viins|main) print -n -- "\E]50;CursorShape=1\C-G";; # line cursor
I've try all different bellow configurations on VIM without success:
http://stackoverflow.com/questions/6488683/how-do-i-change-the-vim-cursor-in-insert-normal-mode
http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes
For example, I can change the shape on iTerm2/VIM with the follow setup:
let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_SR = "\<Esc>]50;CursorShape=2\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
Appreciate any help at all.
Thanks!
Btw for whoever submits a pull request to fix this, here's some CSS that will make the cursor a vertical line:
// custom css to embed in the terminal window
termCSS: '\
.cursor-node {\
background: none !important;\
border: none !important;\
border-left: 1px solid rgba(255, 255, 255, 0.7) !important;\
}',
There is also now a config option for the cursor shape: https://github.com/zeit/hyperterm/blob/master/config-default.js#L13 added in: https://github.com/zeit/hyperterm/commit/e66d6c90f0e8b437b2a631f1709ff240fc769cc8
Not sure if this is helpful, but it looks like something is causing the app to not recognise the cursor style (which is evaluating to 5):

Interestingly, I鈥檓 not able to find the code shown in the above bundle.js anywhere in Hyperterm鈥檚 source code, and it鈥檚 not coming from any of my plugins. 馃
This is the relevant section of my init.vim for Neovim (running on macOS), which accomplishes the same thing as @henryoliver鈥檚 setup above (see here for documentation from Neovim):
let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 " Cursor is pipe in Insert, block in Normal
It's in the hterm-umdjs dependency.
It looks like there are actually two different sets of cursor changing escape codes. The first is ^[[50;CursorShape=1. That's what many people configure their Vim to use. The other one, which Neovim uses, is ^[[5 q. I think the reason Neovim uses this one is because it lets you specify that the cursor should blink. However, hterm only partially supports it. Block and underline cursors are supported, both blinking and not blinking, but I-beam cursors are not.
Fixing this would require fixing hterm, and should be as easy as a quick pull request. Unfortunately, hterm is part of the Chromium OS codebase, and Google does not make anything that easy when it comes to their open-source projects. If someone else can figure out how to contribute code to Chromium, they'd just have to add a few cases here.
Here's the iTerm2 pull request that added these escape sequences:
Interestingly, the neovim special cursor for replace mode does work. It's an underline which hterm does support.
Nice detective work, @tbodt! Hope this helps for future improvements. 馃暤馃徎
It looks like hterm is such a pain in the ass to contribute to that Hyper is already monkey patching it. I'm gonna pull request this.
Fixed in pull request #1286.
Having this issue in the latest version of canary, is it a regression from the change to xterm?
Most helpful comment
Not sure if this is helpful, but it looks like something is causing the app to not recognise the cursor style (which is evaluating to
5):Interestingly, I鈥檓 not able to find the code shown in the above
bundle.jsanywhere in Hyperterm鈥檚 source code, and it鈥檚 not coming from any of my plugins. 馃This is the relevant section of my
init.vimfor Neovim (running on macOS), which accomplishes the same thing as @henryoliver鈥檚 setup above (see here for documentation from Neovim):