I was just learning for an exam (and taking glimpses at irssi) when a thought hit me: “wouldn’t it be nice if Terminator showed the currently running command in the window’s title”.
So, I asked Google and found a pretty nice post on how to do it. At first the proposed solution resulted in some weird messages being printed, but just changing the order of a line fixed it, so here’s the working code for bash in Ubuntu Intrepid:
if [ "$SHELL" = '/bin/bash' ]
then case $TERM in rxvt|*term) set -o functrace export PS1="\e]0;$TERM\007$PS1" trap 'echo -ne "\e]0;$BASH_COMMAND\007"' DEBUG ;; esac fi
Pretty nice, eh? Now, if someone’s up for a challenge: if it showed the command being executed inside screens instead of just “screen -r” that would be even greater.
Edit: And if someone knows how to get WordPress to display the messages properly that would rock.
Edit 2: I’ve just noticed that this breaks tab completion, so it’s not that nice after all.





You could use centerim / centericq – even inside screen, it shows something like “centerim: event from [irc]…” etc. in the window title :-)
oliver: Well, but this is not only for IRC but for any command (and I’m happy with irssi), but thanks :).
Hola,
participaràs a l’olimpiada d’informàtica? T’ho recomano, val molt la pena i s’aprèn moltíssim.
Com és que no vas participar al concurs de benvinguda?
Salutacions,
Enric S. Cusell
Hola Enric,
He començat a fer les pràctiques però dubto que participi en les proves.
És el primer cop que faig alguna cosa amb C++ (o amb qualsevol altre llenguatge d’aquest tipus) i de moment tardo varies hores per fer un sol exercici.
Però bé, encara queda temps fins a l’abril així que fins llavors potser ja hauré après alguna cosa i tot :).
Jo tampoc en sabia. Et recomano participar a tots els concursos, encara que només facis el primer problema o ni tan sols això.
S’aprèn molt, si és que t’agrada.
Fins aviat,
Enric S. Cusell
[...] posts but then leave them for later until they are no longer interesting (except when it’s a stupid post, then I publish it within minutes ;)). Anyway, before this happens again, here you have some [...]
You can have tab-completion too. Here’s what I came up with on msys.
if [ "$SHELL" = '/bin/sh' ]
then
case $TERM in
msys|rxvt|*term)
set -o functrace
trap ‘if [ -z "$FUNCNAME" ]; then echo -ne “\e]0;$MSYSTEM:${PWD/”$HOME”/~} – $BASH_COMMAND07″; fi’ DEBUG
# I’m using the git PS1 which auto-updates the title after command completion.
;;
esac
fi
http://msys.pastebin.com/v9f8Y2QL