mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Introduce DISABLE_AUTO_TITLE option
This commit is contained in:
parent
01b0366f3e
commit
9b48a845d1
3 changed files with 33 additions and 24 deletions
|
|
@ -12,14 +12,18 @@ function title {
|
||||||
}
|
}
|
||||||
|
|
||||||
function precmd {
|
function precmd {
|
||||||
title zsh "$PWD"
|
if [ "$DISABLE_AUTO_TITLE" != "true" ]; then
|
||||||
|
title zsh "$PWD"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function preexec {
|
function preexec {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
local -a cmd; cmd=(${(z)1})
|
local -a cmd; cmd=(${(z)1})
|
||||||
title $cmd[1]:t "$cmd[2,-1]"
|
if [ "$DISABLE_AUTO_TITLE" != "true" ]; then
|
||||||
}
|
title $cmd[1]:t "$cmd[2,-1]"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function zsh_stats() {
|
function zsh_stats() {
|
||||||
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
|
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,23 @@
|
||||||
case "$TERM" in
|
if [ "$DISABLE_AUTO_TITLE" != "true" ]; then
|
||||||
xterm*|rxvt*)
|
case "$TERM" in
|
||||||
preexec () {
|
xterm*|rxvt*)
|
||||||
print -Pn "\e]0;%n@%m: $1\a" # xterm
|
preexec () {
|
||||||
}
|
print -Pn "\e]0;%n@%m: $1\a" # xterm
|
||||||
precmd () {
|
}
|
||||||
print -Pn "\e]0;%n@%m: %~\a" # xterm
|
precmd () {
|
||||||
}
|
print -Pn "\e]0;%n@%m: %~\a" # xterm
|
||||||
;;
|
}
|
||||||
screen*)
|
;;
|
||||||
preexec () {
|
screen*)
|
||||||
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]}
|
preexec () {
|
||||||
echo -ne "\ek$CMD\e\\"
|
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]}
|
||||||
print -Pn "\e]0;%n@%m: $1\a" # xterm
|
echo -ne "\ek$CMD\e\\"
|
||||||
}
|
print -Pn "\e]0;%n@%m: $1\a" # xterm
|
||||||
precmd () {
|
}
|
||||||
echo -ne "\ekzsh\e\\"
|
precmd () {
|
||||||
print -Pn "\e]0;%n@%m: %~\a" # xterm
|
echo -ne "\ekzsh\e\\"
|
||||||
}
|
print -Pn "\e]0;%n@%m: %~\a" # xterm
|
||||||
;;
|
}
|
||||||
esac
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,9 @@ export ZSH_THEME="robbyrussell"
|
||||||
# Uncomment following line if you want to disable colors in ls
|
# Uncomment following line if you want to disable colors in ls
|
||||||
# export DISABLE_LS_COLORS="true"
|
# export DISABLE_LS_COLORS="true"
|
||||||
|
|
||||||
|
# Uncomment following line if you want to disable autosetting terminal title.
|
||||||
|
# export DISABLE_AUTO_TITLE="true"
|
||||||
|
|
||||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
||||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||||
plugins=(git)
|
plugins=(git)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue