forethought
forethought

Reputation: 3253

neovim spits out weird character on terminal upon closing

I have install neovim and linked the .vimrc to the .config/nvim/init file. neovim splits out the following character [2 q% on the terminal screen upon closing. The weird characters even appears when I press : inside neovim.

enter image description here

Upvotes: 1

Views: 958

Answers (1)

Justin M. Keyes
Justin M. Keyes

Reputation: 6964

In Nvim 0.1.7, that happens because your terminal (1) doesn't support cursor shape control sequences, and (2) doesn't properly ignore unknown sequences. To avoid it, put this in your ~/.config/nvim/init.vim:

let $NVIM_TUI_ENABLE_CURSOR_SHAPE=0

That's also mentioned in man nvim.


In Nvim 0.2, cursor styling is controlled by the guicursor option. If you see "weird characters" like [2 q%, it means your terminal (probably) doesn't support this feature, but guicursor was enabled somewhere in your configuration. Disable guicursor by setting it empty:

:set guicursor=

(Nvim disables guicursor by default if it's not sure about your terminal. But if you set guicursor anyway, Nvim will send the cursor shape control sequences to the terminal.)

Upvotes: 6

Related Questions