How do I set a window title to blank?

Asked by Calcipher

By default, byobu uses a blank window title. How do I reset a named window back to this default blank? I've tried backing out all of the title, but having a truly blank title causes it to revert to whatever it was previously.

Question information

Language:
English Edit question
Status:
Solved
For:
byobu Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Dahl
Solved:
Last query:
Last reply:
Revision history for this message
Best Jan Dahl (ubuntu-com-ninja) said :
#1

You can use whitespace to get a "blank" title.

Revision history for this message
Calcipher (calcipher) said :
#2

Thanks Jan Dahl, that solved my question.

Revision history for this message
Jan Dahl (ubuntu-com-ninja) said :
#3

No problem! As an aside, here's a little script you might like to adapt to your needs. I alias 'ssh' to the script so that it updates the window title when I ssh to another box, then update it back to local hostname when I disconnect (or the connection fails - that's the "trap" line)). You might find it useful :-)

#!/usr/bin/env bash

if [ $TERM == "screen-bce" ] ; then
  trap 'echo -n -e "\033k${HOSTNAME}\033\\"' 0 1 2 15
  echo -n -e "\033k$1\033\\"
fi
/usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $*

Revision history for this message
Jan Dahl (ubuntu-com-ninja) said :
#4

Forgot to add, check `echo $term` for what your actual terminal variable is set to when using your byobu. It varies with your terminal client and might be `screen`, `screen-color`, or something fourth.

Revision history for this message
Calcipher (calcipher) said :
#5

Alright, now that is awesome. Thanks!

Revision history for this message
Jan Dahl (ubuntu-com-ninja) said :
#6

Hey Calcipher,

I slapped the code together and shined it up a little (I found an environment variable that persists on different terminals) ad made a similar script for telnet and put it on github, as I ought to have a long time ago:

https://github.com/jandahl/updateScreenWindowTitles

Hope you can use it, and please feel free to fork and add suggestions :)

Revision history for this message
Calcipher (calcipher) said :
#7

Glad you put that on Github, I will have to play with it. I was attempting to stuff all of this (code and all) into .bashrc the other day, but got distracted before I could finish - I might have to try to do it again.