character-encoding - 在 neovim 缓冲区中打印随机字符

标签 character-encoding neovim terminator

我最近开始遇到 Neovim 的一个奇怪问题,其中随机字符在我的 session 中打印。当我在插入模式下按 Space 时,可以复制此内容,如下所示。这些字符在正常模式下消失。 此外,退出 session 后,终端上会打印出一些字符。

Neovim-Session

我猜测这个问题与字符编码有关,并且由于溢出而打印了随机字符,但我不确定。 如果我使用其他终端模拟器,似乎没有问题(我已经用 gnome-terminal 尝试过,一切似乎都工作正常)。

我的系统中 locale 命令的输出 -

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

我目前正在使用terminator使用默认编码 - Unicode UTF-8。我的终结者配置文件可用 here .

我尝试过更改编码,但似乎没有解决问题。任何帮助将不胜感激。

最佳答案

来自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.

关于character-encoding - 在 neovim 缓冲区中打印随机字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42117981/

相关文章:

mysql - 更改服务器变量 character_set_server

python - (Neo)vim python 支持和 active virtualenv 冲突

vim - 在 coc.nvim 的 rust-analyzer 中更改类型提示的颜色

bash - 在 Ubuntu 中为 Terminator(控制台应用程序)中的选项卡设置标题

linux - 如何将终端 Pane 分离到新窗口?

java - 谁将 JVM file.encoding 重置回原始值?

java - 在 Java/JSP 中处理西类牙字符

C++ 字符数组正确移动空终止符?

php - Mysql 将引号存储为 '

vim - 将条件 vimscript 映射转换为 lua (neovim) (在 lua 中提交 <CR>)