mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
better term title support
This commit is contained in:
parent
d0b4e80578
commit
907dc812d7
1 changed files with 19 additions and 5 deletions
24
zshrc
24
zshrc
|
|
@ -3,8 +3,8 @@
|
||||||
autoload -Uz promptinit
|
autoload -Uz promptinit
|
||||||
promptinit
|
promptinit
|
||||||
|
|
||||||
# Set up working dir change event
|
# Set terminal title
|
||||||
chpwd() {
|
set_term_title() {
|
||||||
[[ -o interactive ]] || return
|
[[ -o interactive ]] || return
|
||||||
# Bubble information up to the terminal
|
# Bubble information up to the terminal
|
||||||
case $TERM_PROGRAM in
|
case $TERM_PROGRAM in
|
||||||
|
|
@ -19,15 +19,20 @@ chpwd() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
case $TERM in
|
case $TERM in
|
||||||
xterm*)
|
screen*)
|
||||||
print -Pn "\e]0;%n@%m: %~\a"
|
#print -Pn "\ek%n@%m: %~\e\\"
|
||||||
|
print -Pn "\e]2;%n@%m: %~\a"
|
||||||
|
;;
|
||||||
|
xterm*|*rxvt*)
|
||||||
|
print -Pn "\e]2;%n@%m: %~\a"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# NOOP
|
# NOOP
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
chpwd # call in right now
|
|
||||||
|
set_term_title # call in right now
|
||||||
|
|
||||||
# Use emacs keybindings even if our EDITOR is set to vi
|
# Use emacs keybindings even if our EDITOR is set to vi
|
||||||
bindkey -e
|
bindkey -e
|
||||||
|
|
@ -111,13 +116,22 @@ zstyle ':vcs_info:*' formats "%F{green}%S%f:%F{blue}%b%f:%F{green}%r%f"
|
||||||
precmd() {
|
precmd() {
|
||||||
psvar=()
|
psvar=()
|
||||||
|
|
||||||
|
set_term_title
|
||||||
vcs_info
|
vcs_info
|
||||||
RPROMPT="%F{green}%~%f"
|
RPROMPT="%F{green}%~%f"
|
||||||
[[ -n $vcs_info_msg_0_ ]] && RPROMPT="$vcs_info_msg_0_"
|
[[ -n $vcs_info_msg_0_ ]] && RPROMPT="$vcs_info_msg_0_"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
preexec() {
|
||||||
|
set_term_title
|
||||||
|
}
|
||||||
|
|
||||||
PS1="%B%(?..[%?] )%b%n@%m> "
|
PS1="%B%(?..[%?] )%b%n@%m> "
|
||||||
prompt_opts=(cr percent)
|
prompt_opts=(cr percent)
|
||||||
|
|
||||||
|
chpwd() {
|
||||||
|
set_term_title
|
||||||
|
}
|
||||||
|
|
||||||
source ~/.aliases
|
source ~/.aliases
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue