While using byobu, my terminal tab's title is set to user@fqdn (IP) - byobu
, which can be pretty long depending on the domain. How can I limit it to something shorter, like user@hostname
, or better yet, let zsh
set the title? I have tried setting BYOBU_NO_TITLE=1
, following this bug, but that, I think, allows the local shell to set the title, not the remote one.
This can be very annoying, since Terminator sets every tab header's length to the same, so one very long title is enough to make all of them very long. Worst case, I'd like it if I could simply trim off some of it to a maximum length (like user@f ... byobu
).
I already have added a function to .zshrc
to set the title:
case $TERM in
xterm*|screen*)
if [[ -n $SSH_TTY ]]
then
precmd () {print -Pn "\e]0;%m: %~\a"}
else
precmd () {print -Pn "\e]0;%~\a"}
fi
;;
esac
This works if I don't use byobu:
The tab on the left is an SSH session without byobu, and the one on the right is with byobu.
With Serg's suggestion of setting IP_EXTERNAL
to 1, I can get rid of the IP, shortening the title. I'd prefer a solution that passes on the title set by zsh (or other applications, such as Vim) to the terminal - it looks like byobu/tmux blocks them.