posted on 12:12 PM on Sunday 21 May 2023
I use GNU screen a
lot since I work on remote servers via SSH. I realised that on RedHat
system, the title of the windows have very useful information like the
username, host and path. In Ubuntu, there is nothing but just the shell
name like bash. Took a lot of searching but the fix is actually quite
simple. Just configure the PROMPT_COMMAND variable which is
a command that is executed when the prompt is changed.
Add the following to you .bashrc file:
# add the nice titles in screen
if [ "$PS1" ]; then
case $TERM in
screen*)
PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
esac
fi
The PS1 check ensures that this is an interactive shell
and there is a case to see if the term is screen and if so,
it will add the PROMPT_COMMAND.
The Ring Fit is finally in use (09:09 PM on Sunday 21 May 2023)
The perfect pasta fork (01:08 PM on Saturday 20 May 2023)
Headless Dropbox issue (05:55 PM on Saturday 04 January 2025)
Find symbolic links (08:53 AM on Friday 08 August 2014)
Fat lion (06:17 PM on Saturday 22 April 2023)
vimv (08:46 AM on Thursday 08 July 2021)
zshrc config for home and end keys (02:41 PM on Tuesday 13 July 2021)