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

truncating string in .zprofile



I have the following prexec() in my profile;
preexec () { print -Pn "\033k\033\134\033k[$1]\033\134" }

This prints the command in the screen caption for that window.

What I want to do is limit this window title to n chars.

However, I cannot manipulate the `$1' in the print string.
Even if I try.
substring=$1
preexec () { print -Pn "\033k\033\134\033k[$substring]\033\134" }

then there is no value printed for $substring.

What is the solution?

Thank 
Eric Smith



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