Being creative with quoting:
export PROMPT_COMMAND='perl -e
"\$_=qq(\e]0;$PWD\a);s#/.*(?=/.+/)#...#;print"'
Comparing strokes:
pwd|perl -pe's#.+(?=/.+/)#...#;s#^#\e]0;#;y#\n#\a#'
perl -e"\$_=qq(\e]0;$PWD\a);s#/.*(?=/.+/)#...#;print"
perl -MCwd -e'\$_=cwd;s#.+(?=/.+/)#...#;print+qq(\e]0;\$_\a)'
perl -e'\$_=\$ENV{PWD};s#.+(?=/.+/)#...#;print+qq(\e]0;\$_\a)'
Re performance, the one that uses the Cwd module
is by far the slowest; using the $PWD environment
variable is fastest.
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... 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
- Andrew . Savige
