This is my method of enhancing the GNU Screen window titles. It relies on my interactive shell being /bin/bash.
These scripts will:
- show a plain
#when just the shell (or root shell) is running in that window
- show the name of a running command (so if you run
nice top -d 10it will show
- prepend the title with
#if the user is root, or the command is running with
- show, for selected commands, a filename in braces instead of the command. So running
sudo vi /etc/fstabwould show a title
Matthew Flint, firstname.lastname@example.org
- a machine where you routinely run GNU Screen...
- ... and GNU Bash
Start by downloading the preexec tweak and stash it somewhere. The file doesn't need to be executable.
Now edit your
.bashrc and add this at the end:
# setup preexec and precmd functions . /home/user/path/to/preexec.bash # load the screen preexec stuff . /home/user/path/to/screen-preexec.sh preexec_install
I'm sure there will be bugs, and I'd be happy to receive pull requests ;-)