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)
Listing files with absolute paths (03:05 PM on Wednesday 21 August 2013)
Listing the packages on a debian based system (11:23 AM on Friday 27 September 2013)