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

Re: Change terminal cursor shape from precmd()



[>users]

Tomasz Moskal wrote on Wed, 23 Aug 2017 12:35 +0100:
>    function precmd() {
>      if [[ ! $(id -u) -eq 0 ]]; then
>        echo -ne "\033]12;#fffeb3\007\e[3 q]"
>      else
>        echo -ne "\033]12;#ae0001\007\e[1 q]"
>      fi
>  }

Works for me in xfce4-terminal and in xterm in 'zsh -f'.

If you run 'which precmd' at the interactive prompt, does it show this
function or something else?  (If something else: see precmd_functions)

(Also, zle-line-init might be a better place to put this in)



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