-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tmux's pane_title doesn't update #1092
Comments
Powerlevel10k only sets prompt. It doesn't do anything else. See https://github.com/romkatv/powerlevel10k/blob/master/README.md#which-aspects-of-shell-and-terminal-does-powerlevel10k-affect. If you want to set terminal title, you need to do it separately. |
My point is that this behavior is working for example in |
Yes. |
Try adding this to # Display $1 in terminal title.
function set-term-title() {
emulate -L zsh
if [[ -t 1 ]]; then
print -rn -- $'\e]0;'${(V)1}$'\a'
elif [[ -w $TTY ]]; then
print -rn -- $'\e]0;'${(V)1}$'\a' >$TTY
fi
}
# When a command is running, display it in the terminal title.
function set-term-title-preexec() {
if (( P9K_SSH )); then
set-term-title ${(V%):-"%n@%m: "}$1
else
set-term-title $1
fi
}
# When no command is running, display the current directory in the terminal title.
function set-term-title-precmd() {
if (( P9K_SSH )); then
set-term-title ${(V%):-"%n@%m: %~"}
else
set-term-title ${(V%):-"%~"}
fi
}
autoload -Uz add-zsh-hook
add-zsh-hook preexec set-term-title-preexec
add-zsh-hook precmd set-term-title-precmd Edit: I hereby release this code under the terms of MIT License. |
Thank you! |
@romkatv Is it ok if I use your title setting zsh snippet to write a small plugin for personal use? I am thinking of using the Blue Oak Model License 1.0.0 for the plugin. |
Sure. I've added a comment stating that the code is available under the terms of MIT License (the same as Powerlevel10k).
I don't know this license. I cannot tell whether it's compatible with MIT or not. |
Thank you very much. You can find the plugin here. |
I just switched to
powerlevel10k
recently and noticed that inside tmux pane titles ceased to update.I have following tmux setup in order to enable pane title update:
How it worked before (at least with
pure
theme):Enter to tmux session and note PWD, let say it's
/home/user/test
.So with aforementioned tmux setup, its pane title should display
test
. Changing dir up one level withcd ..
should change pane title touser
. However it doesn't work withpowerlevel10k
theme.The text was updated successfully, but these errors were encountered: