From 576e13db789ab3acd987c5de8c0353a6030c69bd Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Mon, 7 Feb 2022 11:05:36 +0100 Subject: [PATCH] base: set the title of the terminal when connecting to a server --- CHANGELOG | 2 ++ roles/base/files/kshrc | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index a2a2949..63e931f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- base: set the title of the terminal when connecting to a server + ### Changed - accounts: use "evobsd_internal_group" for SSH authentication diff --git a/roles/base/files/kshrc b/roles/base/files/kshrc index 090c4c6..5a4000a 100644 --- a/roles/base/files/kshrc +++ b/roles/base/files/kshrc @@ -6,6 +6,15 @@ alias history="fc -l 0" # Caracterisation du shell ## +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + bind -m '^L'='^U 'clear'^M^Y' bind '^[[4~'=end-of-line bind '^[[1~'=beginning-of-line