第二个 UDF 执行转换操作,进行换码符替换。
The second UDF performs conversion with substitution escape character replacement.
另一个需要注意的是需要告诉 Zsh 在提示符中哪些字符构成换码序列,否则就会假设它们都是可打印字符,光标的位置就会出错。
Another point to be aware of is the need to tell Zsh which characters form escape sequence in a prompt, otherwise it will assume they are all printable characters, and position the cursor incorrectly.
应用推荐