yellowflash
yellowflash

Reputation: 65

Random characters getting printed in neovim buffer

I have recenty started to get a weird isssue with neovim where random characters get printed in my session. This can be replicated when I press Space in insert mode show below. These characters go away in normal mode. Also, after quitting from a session, there are some characters which get printed out on the terminal.

Neovim-Session

I am guessing that this issue is related with the character encoding, and the random characters are getting printed due to overflow, but am not sure. There seems to be no issue if I use some other terminal emulator (I have tried this with gnome-terminal and everything seems to be working fine there).

Output of locale command in my system -

LANG=en_IN
LANGUAGE=en_IN:en
LC_CTYPE="en_IN.UTF-8"
LC_NUMERIC="en_IN.UTF-8"
LC_TIME="en_IN.UTF-8"
LC_COLLATE="en_IN.UTF-8"
LC_MONETARY="en_IN.UTF-8"
LC_MESSAGES="en_IN.UTF-8"
LC_PAPER="en_IN.UTF-8"
LC_NAME="en_IN.UTF-8"
LC_ADDRESS="en_IN.UTF-8"
LC_TELEPHONE="en_IN.UTF-8"
LC_MEASUREMENT="en_IN.UTF-8"
LC_IDENTIFICATION="en_IN.UTF-8"
LC_ALL=en_IN.UTF-8

I am currently using terminator with the default encoding - Unicode UTF-8. My configuration file for terminator is available here.

I have tried changing encodings but it didn't seem to solve the issue. Any help will be greatly appreciated.

Upvotes: 2

Views: 2967

Answers (3)

weima
weima

Reputation: 4902

This helped my issue.

Hope this helps.

https://github.com/neovim/neovim/wiki/FAQ#nvim-shows-weird-symbols-2-q-when-changing-modes

Upvotes: 1

Justin M. Keyes
Justin M. Keyes

Reputation: 6964

From the Neovim FAQ:

This is a bug in your terminal emulator. It happens because Nvim sends cursor-shape termcodes by default, if the terminal appears to be xterm-compatible (TERM=xterm-256color).

To workaround the issue, you can:

  • Use a different terminal emulator
  • Disable guicursor in your Nvim config:
  :set guicursor=
  " Workaround some broken plugins which set guicursor indiscriminately.
  :autocmd OptionSet guicursor noautocmd set guicursor=

See also :help $TERM for recommended values of $TERM.

Upvotes: 2

yellowflash
yellowflash

Reputation: 65

It seems the random characters were occurring because I installed the unstable version of neovim via ppa:neovim-ppa/unstable on Ubuntu 16.10.
The error went away on building the stable version v0.1.7 from source.

Upvotes: 0

Related Questions