zsh中的有线字符

Wired character in zsh

我在使用非英语语言的命令行 zsh 时遇到问题 但在输入键后语言显示正确的单词,尝试 OSX 也有同样的问题。

~   
❯ สว<0e31>สด<0e35>
สวัสดี
zsh: command not found: สวัสดี

我检查了语言环境一切都是 utf8

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

并检查是否有任何字体,它有同样的问题。 我使用 zsh 5.0.2oh-my-zh

你可以做到 setopt combiningchars.

COMBINING_CHARS

Assume that the terminal displays combining characters correctly. Specifically, if a base alphanumeric character is followed by one or more zero-width punctuation characters, assume that the zero-width characters will be displayed as modifications to the base character within the same width. Not all terminals handle this. If this option is not set, zero-width characters are displayed separately with special mark-up.

-- zshoptions(1) COMBINING_CHARS