diff options
author | ubq323 <ubq323@ubq323.website> | 2023-06-13 15:54:50 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-06-13 15:54:50 +0100 |
commit | 76d6dc6bce328ce38e4800a43e44d2f91d18f7bf (patch) | |
tree | 054b2e74900c60b61e89be5aa0243e63ac399e7a | |
parent | badb9da3f580cc48288b616f2f635cf8a83f5fcd (diff) |
remote terminal title
-rw-r--r-- | .bashrc | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |