Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Adrien Dorsaz
config
Commits
8968c224
Commit
8968c224
authored
Sep 14, 2021
by
Adrien Dorsaz
Browse files
zsh: set terminal title dynamically
parent
a2a16585
Changes
1
Hide whitespace changes
Inline
Side-by-side
zshrc
View file @
8968c224
...
...
@@ -33,3 +33,16 @@ zstyle ':completion:*' verbose true
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
function precmd_set_terminal_title() {
local title="${2}"
echo -en "\e]2;${title}\a"
}
precmd_functions+=(precmd_set_terminal_title)
function preexec_set_terminal_title() {
local title="$(basename "${PWD}"): ${2}"
echo -en "\e]2;${title}\a"
}
preexec_functions+=(preexec_set_terminal_title)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment