aboutsummaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2021-01-21 11:18:08 +0100
committerMiquel Sabaté Solà <msabate@suse.com>2021-01-21 11:18:08 +0100
commit8f518ce3832db45ea25afd8ad548a16b6f579ca3 (patch)
treedd194315718462b490fb7ef23025fd77100e7f98 /.bashrc
parente78521bb6bddd9159e81ae718587ed0b6b5302b2 (diff)
downloaddotfiles-8f518ce3832db45ea25afd8ad548a16b6f579ca3.tar.gz
dotfiles-8f518ce3832db45ea25afd8ad548a16b6f579ca3.zip
bash: set the PROMPT_COMMAND environment variable
This is useful for terminals that don't touch the title bar by themselves like alacritty, which expected the application to actually change it. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc4
1 files changed, 4 insertions, 0 deletions
diff --git a/.bashrc b/.bashrc
index eb99159..8b5cfa2 100644
--- a/.bashrc
+++ b/.bashrc
@@ -57,6 +57,10 @@ alias vi=vim
# We want a full-fledged 256-color terminal.
TERM=xterm-256color
+# Setup the prompt command for terminals that don't touch it by themselves
+# (e.g. alacritty).
+PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
+
# Set the LESS and the PAGER environment variables.
export LESS="FSRX"
export PAGER=less