3 ms·
Putting Text in Window Title Bars
- makecheck 17y agoThe article mentions that the OS and shell matter, but I think this is mainly due to differences in the behavior of "echo". The "printf" program is at least consistent. What actually matters for this is the declared terminal type, and the terminal program you're using. In this case, the article uses sequences I don't recognize and doesn't specify what terminal is supposed to support them. None of their echoes work for me. But perhaps a more common and supported approach is xterm: - use a terminal program that supports and declares the right type, e.g. "xterm-color" - use xterm-style title sequences, and "printf" to print them, such as: printf "\033]; `pwd` \007"
- _dan 17y agoI use a little perl script, because it works everywhere I need it (and I suck at shell scripting ;)) > cat `which title` #!/usr/bin/perl print( "\x1b", "]2;", join(' ', @ARGV), "\x7", );