From 76d6dc6bce328ce38e4800a43e44d2f91d18f7bf Mon Sep 17 00:00:00 2001 From: ubq323 Date: Tue, 13 Jun 2023 15:54:50 +0100 Subject: remote terminal title --- .bashrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3