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

did the way arrays get indexed change between 4.2 and 4.3?



I am using zsh-4.3.4

I am using the following function to put the current working directory and penultimate directory in a tab on iTerm (also works with Konsole):

settab () {
        tab_label="$PWD:h:t/$PWD:t"
        rlength="20"
        echo -ne "\e]1;$tab_label[-$rlength,-1]\a"
}

The idea is that if the string is longer than 20 characters, it truncates it from the right, instead of the left (default behavior).

On 4.3.4 this works great. On 4.2.3, if the original string has fewer than 20 characters, the tab is blank.

Is there a decent work-around, as I hate to conditionally test for the zsh version every time the tab dynamically updates.





William G. Scott

contact info:  http://chemistry.ucsc.edu/~wgscott






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