From 8f518ce3832db45ea25afd8ad548a16b6f579ca3 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 21 Jan 2021 11:18:08 +0100 Subject: bash: set the PROMPT_COMMAND environment variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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à --- .bashrc | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.bashrc') 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 -- cgit v1.2.3