Last active
July 21, 2023 14:43
-
-
Save peterroth/0fee3de793e001d5a46e841dfd9cd66a to your computer and use it in GitHub Desktop.
How to modify .bashrc to show "localhost" if we are working on the local machine and show the remote machine's name if we are logged in on a remote one in the terminal's header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case "$TERM" in | |
xterm*|rxvt*) | |
if [ $(hostname) == proth-laptop ]; then | |
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}localhost: \w\a\]$PS1" | |
else | |
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" | |
fi | |
;; | |
*) | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment