Improve titlebar content
Shows entire previous command, followed by '- Alacritty ($host)'
This commit is contained in:
parent
db2b6142a2
commit
f9e688dac0
14
bash/bashrc
14
bash/bashrc
|
@ -52,10 +52,18 @@ if ! shopt -oq posix; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if [[ -z $TERM_TITLE ]]; then
|
||||
TERM_TITLE="$TERM";
|
||||
fi
|
||||
|
||||
# Set window title to last command
|
||||
PROMPT_COMMAND='echo -e -n "\033]2;$_\007"'
|
||||
# Reconfigure prompt after each return
|
||||
PROMPT_COMMAND="$PROMPT_COMMAND; source ${HOME}/.dotfiles/bash/prompt.sh"
|
||||
function last_command {
|
||||
local h="$(history 1)";
|
||||
echo "${h##*([[:space:])+([[:digit:]])+([[:space:]])}"
|
||||
}
|
||||
PS0='\[\e]0;$(last_command) - $TERM_TITLE\a\]'
|
||||
# Update prompt
|
||||
PROMPT_COMMAND="source ${HOME}/.dotfiles/bash/prompt.sh"
|
||||
# Bell when prompt is returned to mark as urgent
|
||||
PROMPT_COMMAND="$PROMPT_COMMAND;printf \"\a\"; history -a"
|
||||
|
||||
|
|
Loading…
Reference in New Issue