Can you dynamically set the title of new tabs in gnome terminal?
It's really handy to have tabs in gnome terminal, and I often use several. Often, however, I lose track of who's who.
Unlike, say, a browser, gnome-terminal keeps the same default title on all tabs. Yet, under the Title and Command tab (edit - current profile), it says: Quote:
According to Code:
man gnome-terminal Code:
gnome-terminal -t <my_title> This indeed works fine. Now, I'd like to be able to set the title of a new tab. While a new tab can be opened either from the menus or from the keyboard, commands seem to only open new windows. So, I can not use the -t flag to set the title of a new tab... Is there a way of doing this which escapes me? Thanks. jackn |
First, maybe clicking or double-clicking or right-clicking on tab caption will allow you to set its caption after it is open. Also I have a script
Code:
\echo -e "\x1B]2;$1\x07"; |
I've tried the command raskin provided. I wasn't able to get it to work. Maybe I don't know how to. I provided an argument both after the semicolon and with the semicolon removed. I also tried to remove the leading slash.
As to the answer, I've made some progress. A simple way is to use the menus: Terminal - set title (which can be done without leaving the keyboard: Alt-t, s). As to the command line, Mariano Suárez-Alvarez, one of the two authors of gnome-terminal kindly provided the following answer: I only understand this very paritally - an xterm control sequence is provided first in principle, and then a concrete example, which solves the current problem. I've tried it and it works very well. The command line, as opposed to the menus, has the advantage of allowing the setting up of a simple alias. raskin's script is similar to Mariano's command. The -e flag in the 'echo' command allows 'echo' to understand escape backslashes. Thank you for your help, raskin. Sorry about the double post, acid kewpie. I wasn't trying to get attention, I thought I was an editing, not reposting. jackn |
Really my command should do exactly the same as Alvarez's ... It just uses another notation for nonprintables (and backslash crept in my script and was left unnoticed because it does not change behavior). Try
Code:
echo -e '\033]2;Hello\007' | hexdump |
Here you go, raskin:
Code:
~$ echo -e '\033]2;Hello\007' | hexdump |
Try running the same command ( echo -e '\033]2;Hello\007' ) in xterm. Will its caption change? If exactly the same command changes xterm's caption, but doesn't affect gnome-terminal, I would suspect bug in gnome-terminal (possibly introduced by distribution).
|
The command you had me run works both in xterm and in gnome-terminal.
I'm not sure what the purpose of this experiment was, as it's the command that I used to begin with, and that worked, in gnome-terminal. Could you enlighten me a bit on what's going here with the xterm control sequences and hexdump, or where I could find out more about that? I have no idea what's going on it wouldn't hurt to learn a thing or two. jackn |
Sorry, then I just misunderstood you. From your post I thought you had some problem (now I see that I misread it), and fell into standard escape-code debugging procedure. Sorry once again...
|
Thanks for your help and attention, raskin.
jackn |
Just to complete this thread with what I've learned since, which might come in handy.
Obviously, there are menu options for this, accessible with the mouse: Terminal - Set Title. More interestingly, like other menu items, this is accessible from the keyboard: Alt+t for the 'Terminal' menu, then 's' for 'Set title'. Nicer yet, as the help manual says, the 'grave' (as in the French accent, also known as the 'backtick') key, directly gives rise to the 'Set title' dialogue box. Nicest of all, key bindings for all such menu items can be easily set. Once the menu is dropped down and the item is highlighted, any key combination (other than the one activating the item) entered will become a shortcut. The shortcut just entered will figure to the right of the menu item, as shortcuts usually do. Changed your mind? Just type in another one. Finally want none? Hit backspace, and the shortcut is blank. jackn |
All times are GMT -5. The time now is 03:56 AM. |