summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-06-13 15:54:50 +0100
committerubq323 <ubq323@ubq323.website>2023-06-13 15:54:50 +0100
commit76d6dc6bce328ce38e4800a43e44d2f91d18f7bf (patch)
tree054b2e74900c60b61e89be5aa0243e63ac399e7a
parentbadb9da3f580cc48288b616f2f635cf8a83f5fcd (diff)
remote terminal title
-rw-r--r--.bashrc8
1 files changed, 7 insertions, 1 deletions
diff --git a/.bashrc b/.bashrc
index d77d158..9bc6ef7 100644
--- a/.bashrc
+++ b/.bashrc
@@ -19,8 +19,14 @@ bind -s 'set completion-ignore-case on'
# title
set_title () { printf "\e]2;%s\e\\" "$1"; }
_lastcmd () { history 1 | sed -e 's/^ *[0-9]* *//g' ; }
+_dirtitle () {
+ if [ -n "$SSH_CONNECTION" ]; then
+ echo "$(uname -n):"
+ fi
+ apwd
+}
trap 'set_title "$(_lastcmd)"' DEBUG
-PROMPT_COMMAND='history -a; set_title "$(apwd)"'
+PROMPT_COMMAND='history -a; set_title "$(_dirtitle)"'
# aliases
. ~/.aliases.bashrc