I want to use block cursor for normal mode, bar cursor for insert mode in both vim and bash vi mode, a minimal setting can look like this:
vimrc -------- let &t_SI = "\e[5 q" let &t_EI = "\e[2 q" .inputrc -------- set vi-cmd-mode-string \1\e[2 q\2(c) set vi-ins-mode-string \1\e[5 q\2(i)
They work fine on their own, but broke when you switch from bash to vim.
If I execute
vim in bash, the initial cursor for vim is bar in normal mode.
If I suspend
c-z and use
fg to get it back, the cursor also becomes a bar in normal mode.
It's annoying to use
i<esc> to restore cursor to block in vim.
If I run command in readline vi cmd mode instead of vi ins mode, the problem vanished away, I'm not sure it's the right way, it's annoying to return to cmd mode before executing a command.
Are there other ways to deal with it?
I use urxvt v9.22, vim8.2, bash4.4.2, ubuntu18.04