dotfiles/zsh/.config/zsh/window-title-bar.sh

19 lines
580 B
Bash

#!/bin/zsh
if [[ "${TERM}" != "" && "${TERM}" == "alacritty" ]]
then
precmd()
{
# output on which level (%L) this shell is running on.
# append the current directory (%~), substitute home directories with a tilde.
# "\a" bell (man 1 echo)
# "print" must be used here; echo cannot handle prompt expansions (%L)
print -Pn "\e]0;$(id --user --name)@$(hostname): zsh[%L] %~\a"
}
preexec()
{
# output current executed command with parameters
echo -en "\e]0;$(id --user --name)@$(hostname): ${1}\a"
}
fi