Почистил и ускорил zsh
This commit is contained in:
parent
74e201e92c
commit
b3f074faff
6 changed files with 279 additions and 2396 deletions
30
zsh/title.zsh
Normal file
30
zsh/title.zsh
Normal file
|
@ -0,0 +1,30 @@
|
|||
function title {
|
||||
emulate -L zsh
|
||||
setopt prompt_subst
|
||||
|
||||
[[ "$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
|
||||
xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|kitty|wezterm|st*)
|
||||
print -Pn "\e]2;${2:q}\a" # set window name
|
||||
print -Pn "\e]1;${1:q}\a" # set tab name
|
||||
;;
|
||||
screen*|tmux*)
|
||||
print -Pn "\ek${1:q}\e\\" # set screen hardstatus
|
||||
;;
|
||||
*)
|
||||
# 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
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue