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

Re: My zshrc; any sugestions welcome



On Mar 26,  5:46pm, Marijan Peh wrote:
} Subject: Re: My zshrc; any sugestions welcome
}
} > } > > This display just first letter of current running job. ex:
} > } > > I run 'top' but is shows only 't' in titlebar.
} > 
} > Hmm, it works for me.  Show us your whole command line, again?
} 
} preexec () {print -Pn "\033]0;%n@%m ${${(@)${(z)1}:#*[[:punct:]]*}[1]} %~\007"}

Oh, silly me.  Single-element arrays are treated as scalars, so if the
command consists of only one word, you get only the first letter, but
if it consists of multiple words you get the first word.  I never tried
it with a command with no arguments.

So try this:

preexec () {
  print -Pn "\033]0;%n@%m ${${(@)${(z)1}:#*[[:punct:]]*}%% *} %~\007"
}

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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