Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Escape sequences are not interpreted by "zle -M"



Hello everyone,

I noticed a bug (I believe), where escape sequences (for example color
codes) do not work as intended when beeing displayed with "zle -M".
A minimal working example (with "zsh -f") that showcases what I mean:

$ echo $TERM
st-256color
$ zle-line-init () { zle -M "^[[38;5;1mred" }
$ zle -N zle-line-init

After that, the string displayed below the prompt is the literal string
"\033[38;5;1mred" (without any colors applied). I inserted the escape
character via Ctrl+V. I also tested with \033 instead of the escape
character, but I get the same result.
Running
$ echo "^[[38;5;1mred"
works as intended and displays the string "red" in the correct color.

I am using zsh version 5.9 (x86_64-pc-linux-gnu) on ArchLinux and my
terminal is st, but I also tested on gnome-terminal and allacrity with
the same result.

If someone knows how to fix this, or if this is fixed at any point,
please let me know! (Btw. I'm not subscribed to the mailing list, so I
would appreciate it, if I could get a direct answer.)

Fabian




Messages sorted by: Reverse Date, Date, Thread, Author