Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: did the way arrays get indexed change between 4.2 and 4.3?
- X-seq: zsh-users 11666
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: wgscott@xxxxxxxxxxxxxxxxxx
- Subject: Re: did the way arrays get indexed change between 4.2 and 4.3?
- Date: Wed, 25 Jul 2007 03:28:10 +0200
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=C5O4i5r+oU7QvC5d5Csedyvg0pmfMOFzPD/YzO1ZMEozX/2qkzxV7mBqyWWKZaBdGQlXMKaNC1uElNdkJOTWB8OwEBYEXr37DtVKdt6eGQwfJBsrRtAnTTo2bluKPbK8NPt7I0hi38aCiuC9Gamk6QT6kJZ4jsbrc29OldfGd9k=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pbJNyGGvj7jJV42GBml/HVA7b1PT0Ai+PwlCvgTV2ahHFb6iZdMYfppqjSJVdehnUiw7m9wYNUplDeKUUZ+zej1ORNuuXEqMFbPKcgq9fRtCI+xu6yu2taBBPlxdQ4Xn3MvkWfLaIGpdqGZRONzcja0zXz3CL6ET9YrzbonIGvQ=
- In-reply-to: <19FD3CB1-1DA7-4FFC-B369-418748C70F73@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <19FD3CB1-1DA7-4FFC-B369-418748C70F73@xxxxxxxxxxxxxxxxxx>
On 25/07/07, William Scott <wgscott@xxxxxxxxxxxxxxxxxx> wrote:
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.
I don't know the real answer, but you can at least do it the other way around.
Ie, define a different settab depending on zsh version when the rc
file is parsed.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author