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.
UPDATE: April 10, 2015
My current solution that does not depend on the use of shell or terminal is to use
wmctrl
from a script, and place full path to the script in.byoburc
. Works with gnome-terminal, terminator, sakura - just about any termimal Here's the script:Original post
As far as
gnome-terminal
goes, you can set profile preferences to keep the initial title specified in the profile settings. Bellow is the screenshot of my byuobu with keep the initial title option, and with replace initial title optionAs for Terminator, I'll download and see if same applies to it.
i have found that byobu uses tmux in the back end. and tmux does have some ways to set the terminal title with the following lines in
.byoubu/.tmux.conf
:where
#(pwd)
sets it to the working directory the range of options can be found in the man page of tmux under the formats sectiondigging a little deeper it seems that byobu by default comments exactly these two lines out in
/usr/share/byobu/profiles/tmux
to set its own custom title