update terminal title from standard output of long running command?
- by Sam Hasler
I'd like to change the title of a terminal window during a long running command (for example: git svn fetch) with values greped from the output, whilst still writing to standard output.
Is this possible using named pipes or tee and xargs?
I'm thinking something like
git svn fetch | sed "s/^\(r\d*\).*$/ \"\\\033]0;\"\1\"\\\007\"/" | xargs -l1 echo -ne
based on: http://tldp.org/HOWTO/Xterm-Title-3.html
Update:
getting this to work would be enough:
(echo "r9" ; echo "r10") | sed "s/^\(r\d*\).*$/ \"\\\033]0;\"\1\"\\\007\"/" | xargs -l1 echo -ne
Update 2:
This almost does what I want. I see r10, but not r9:
(echo "r9" ; sleep 1 ; echo "r10") | sed "s/^\(r[0-9]*\)\.*$/\\\033]0;\1\\\007/" | xargs -0 echo -ne