1
0
Fork 0

Fix terminal titles

This commit is contained in:
Malte Brandy 2021-03-08 16:43:18 +01:00
parent 3aef60e622
commit 6d9616f9bb
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
4 changed files with 47 additions and 0 deletions

View file

@ -25,6 +25,8 @@
extraConfig = ''
set -g set-titles on
set -g status off
set -g set-titles-string '#T - #W - tmux @ #h'
set -g allow-rename on
'';
};
password-store = {

View file

@ -21,6 +21,7 @@ set laststatus=2
set incsearch
set mouse=
set showcmd
set title
set backupdir=~/.vimbackupfiles/
set undodir=~/.vimhist/

View file

@ -17,6 +17,15 @@
plugins = [ "colored-man-pages" ];
};
plugins = [
#{
#name = "titles";
#src = pkgs.fetchFromGitHub {
#owner = "jreese";
#repo = "zsh-titles";
#rev = "b7d46d7";
#sha256 = "0rca9a22vz11pnkks5vlspfnmd3m1s38hz901gvgfa39ch3va9ad";
#};
#}
{
name = "auto-notify";
src = pkgs.fetchFromGitHub {

View file

@ -6,6 +6,41 @@ if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
fi
mkdir -p /var/run/user/$UID/tmp/downloads
function title {
emulate -L zsh
setopt prompt_subst
[[ "$INSIDE_EMACS" == *term* ]] && return
# if $2 is unset use $1 as default
# if it is set and empty, leave it as is
: ${2=$1}
case "$TERM" in
cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|st*)
print -Pn "\e]2;${2:q}\a" # set window name
print -Pn "\e]1;${1:q}\a" # set tab name
;;
screen*|tmux*)
printf '\033]2;%s\033\\' "`print -Pn "${1:q}"`"
;;
*)
if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;${2:q}\a" # set window name
print -Pn "\e]1;${1:q}\a" # set tab name
else
# Try to use terminfo to set the title
# If the feature is available set title
if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then
echoti tsl
print -Pn "$1"
echoti fsl
fi
fi
;;
esac
}
setopt prompt_subst
autoload -U colors && colors # Enable colors in prompt