Andrew Savige wrote:
> So the new leader is:
>
> export PROMPT_COMMAND="pwd|perl -pe
> 's#.+(?=/.+/)#...#;s#^#\e]0;#;y#\n#\a#'"
If you limit it to a single Perl program, the Cwd module
saves one stroke on $ENV{PWD}. To make it easier to compare
lengths, I have omitted 'export PROMPT_COMMAND...' below:
pwd|perl -pe's#.+(?=/.+/)#...#;s#^#\e]0;#;y#\n#\a#'
perl -MCwd -e'\$_=cwd;s#.+(?=/.+/)#...#;print+qq(\e]0;\$_\a)'
perl -e'\$_=\$ENV{PWD};s#.+(?=/.+/)#...#;print+qq(\e]0;\$_\a)'
Andrew.
- Re: Fun with xterm window titles, or Yet Another golf chal... Newton, Philip
- Re: Fun with xterm window titles, or Yet Another golf chal... Newton, Philip
- Re: Fun with xterm window titles, or Yet Another golf chal... Newton, Philip
- Re: Fun with xterm window titles, or Yet Another golf chal... Andrew . Savige
- Re: Fun with xterm window titles, or Yet Another golf chal... Newton, Philip
- Re: Fun with xterm window titles, or Yet Another golf chal... Andrew . Savige
- Re: Fun with xterm window titles, or Yet Another golf chal... Pense, Joachim
- RE: Fun with xterm window titles, or Yet Another golf chal... Andrew . Savige
- RE: Fun with xterm window titles, or Yet Another golf chal... Andrew . Savige
- RE: Fun with xterm window titles, or Yet Another golf chal... Andrew . Savige
