add title bar string stack

Bug #1475123 reported by Mark Smith
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Terminator
Won't Fix
Undecided
Unassigned

Bug Description

i would like to see a title bar string stack. i could not find such a feature on terminator as of yet. as implemented in xterm, basically send '\033[22t' to add to the stack, then '\033[23t' to restore.

this allows the customer to do things like the following:
1. add the current title bar value to the stack
2. set the title bar to a remote hostname
3. ssh to that remote host
4. restore the previous stack string value

this works on an xterm:
1. echo -ne '\033[22t'
2. echo -ne '\033]2;your-host-name'
3. ssh your-host-name
4. echo -ne '\033[23t'

conveniently setting the title bar to the name of the host and then resetting it back to whatever it was before after the completion of the ssh command.

Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

This would actually be handled by the vte component Terminator is based on. You should raise a feature request against that project. Either they would implement the whole thing and we would just set the title to whatever the terminal says the title should be (like now as long as we're not overriding the title) or they would create a signal/function that we can receive/call to get this stack.

BTW, When I run your command in xterm the title gets set to "your-host-name?0;previous-string". Not clear is where the "?0;" is coming from. Also, if this is a stck, shouldn't I be able to run a second (2) and get "your-host-name?0;your-host-name?0;previous-string"? Right now it just lets me set the prefix effectively.

I'm going to mark this as Won't Fix for now, because as I say I don't think these escape codes for this can (or should) be handled at the Terminator level.

Changed in terminator:
status: New → Won't Fix
Revision history for this message
Mark Smith (mark-launchpad-d) wrote :

Hi Stephen, thanks for your time. I really like Terminator except for these little niggles I run into from time to time.

Is it possible to have your team create a feature request with "vte" project. I don't have any relationship with them, nor do I even know what that project does. Due to this, I wouldn't have a clue as to how to encapsulate the idea as a feature request to them.

The real feature request is I would like to be able to set the title, then restore the title to what it was. Logically, you can do this by one of two methods: get the current value of the titlebar, save that, set the new value, then set the old value back after you done. Alternatively, and less intuitively, you can tell the application to save the current value, set the new value, and then later on tell the application to restore the previous value.

I see what you mean by the wording of "stack," but it's just the terminology the xterm guys use to describe it. The reason why the xterm guys decided up a stack instead of just returning the title value, they had decided it's a security risk to allow users to set the title bar. The basic gist of the security risk is that you can trick someone.

Not sure where your "?0;" is coming from. When I tried it on my xterm it worked perfectly. When I run "xterm -v" it reports "XTerm(271)" and exits. I'm running it on my Ubuntu "Precise" 12.04.5 LTS system.

Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

A team, he says! All my little yellow minions scurrying about doing my bidding. :-)

FYI: vte is the library/widget that provides the terminal emulator. GNOME Terminal also uses this widget, plus some other projects too.

I don't really have a relationship with them per se. They might be aware of me at same level a naturalist is aware of ants.

Raised as https://bugzilla.gnome.org/show_bug.cgi?id=752514

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Note that while the stacking request is a valid one and is on the todo list of vte developers, I don't think this is the best approach to achieve what's outlined in this bugreport.

> add the current title bar value to the stack
> set the title bar to a remote hostname
> ssh to that remote host
> restore the previous stack string value

It is cumbersome to set up (e.g. ssh needs to be an alias or so which won't work if you call ssh from a script, or similar), and it breaks if the ssh session emits an unbalanced amount of push/pop sequences. This could happen e.g. if you hop to another host from there (pushing the title to the stack again) and the outer connection breaks.

I personally find it much more robust if each shell prompt sets the title (both locally and on your remote hosts). I believe this is what Ubuntu + newer vte-based terminals (e.g. gnome-terminal) do by default, and this doesn't need title stacking. Of course it has its drawbacks too, e.g. you can't quickly do one-off changes to your terminals and have that value restored later - but if you do such manual changes, you probably want to keep that value across ssh too. Anyway, it's something for you to consider.

Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Raised bug was duplicate of https://bugzilla.gnome.org/show_bug.cgi?id=699819 which was already there but didn't come up in the suggestions at the time.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.