Add terminal title to prompt function
This commit is contained in:
parent
f76494da36
commit
f988d80d78
@ -54,6 +54,14 @@ function prompt_fred_precmd {
|
||||
|
||||
(( PWDWIDTH = ($COLUMNS-20) * 1/4 ))
|
||||
vcs_info
|
||||
|
||||
#Terminal Title
|
||||
print -Pn "\e]0;%~:zsh\a"
|
||||
}
|
||||
|
||||
function prompt_fred_preexec {
|
||||
#Terminal Title
|
||||
print -Pn '\e]0;%~:${1}\a'
|
||||
}
|
||||
|
||||
function prompt_fred_setup {
|
||||
@ -72,6 +80,7 @@ function prompt_fred_setup {
|
||||
|
||||
# Add hook for calling precmd before each command.
|
||||
add-zsh-hook precmd prompt_fred_precmd
|
||||
add-zsh-hook preexec prompt_fred_preexec
|
||||
|
||||
# Define prompts.
|
||||
PROMPT='$(prompt_context)%F{cyan} %${PWDWIDTH}<..<%~%f$(prompt_git)$(prompt_prefix)'
|
||||
|
Reference in New Issue
Block a user