After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699819 - support title stacking (CSI 22 t / CSI 23 t)
support title stacking (CSI 22 t / CSI 23 t)
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: VTE Maintainers
VTE Maintainers
[fixed:vteparser]
: 752514 (view as bug list)
Depends on: vteparser
Blocks:
 
 
Reported: 2013-05-07 10:10 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2018-08-04 21:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stefan Sauer (gstreamer, gtkdoc dev) 2013-05-07 10:10:45 UTC
As the CSI code to get the title is not implemented due to security issues, it would be nice to support the above codes. This way an app can push the current title on the stack, set a new title and restore the prev title from the stack.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2013-05-31 07:13:50 UTC
just for testing: this works in xterm:
echo -e "\e[22;0t"; echo -e "\e]0;test\007"; sleep 1s; echo -e "\e[23;0t"; sleep 1s;
Comment 2 Egmont Koblinger 2015-07-17 07:58:56 UTC
*** Bug 752514 has been marked as a duplicate of this bug. ***
Comment 3 mattator@gmail.com 2016-09-11 14:55:34 UTC
This would be a great addition. I have my WM override window title and neovim can't restore the title on exit (https://github.com/neovim/neovim/issues/4063), thus leaving me with incorrect window titles. With this ticket, neovim (and others) could restore the original title.
Comment 4 Christian Persch 2018-02-05 23:50:49 UTC
xterm's stack is unlimited, and not cleared on reset.

I think we should have a tight limit (maybe 4, or 8 at most), and should clear the stack on reset.
Comment 5 Christian Persch 2018-02-08 22:30:07 UTC
When the stack limit is reached, and another push done, should that a) no-op the push, or b) drop the bottommost entry from the stack and push the new entry on top?
Comment 6 mattator@gmail.com 2018-03-19 06:23:37 UTC
I would vote for a noop, b) might lead bad applications to mess up titles set up by previously honest apps. An easyfix should a problem rise with a) is to increase the stack. a) seems a safer bet.
Comment 7 Christian Persch 2018-03-27 17:47:59 UTC
Fixed on master.

I went for dropping the bottommost stack entry instead.
Comment 8 Egmont Koblinger 2018-08-04 21:02:08 UTC
Geez, I completely missed this one. Thanks! :)

I agree with the b) approach.

(In reply to mattator@gmail.com from comment #6)
> I would vote for a noop, b) might lead bad applications to mess up titles
> set up by previously honest apps.

Intentionally bad (malicious) apps can mess up anything with either approach, e.g. they can just pop the entire stack and their set up their title.

Accidentally bad apps are IMO most likely to crash, i.e. push something but then forget to pop.  b) seems to recover better from this situation.  With a) one could find that eventually (after a couple of such events) setting and restoring the title stops working in the terminal even for well-behaved apps.
Comment 9 Egmont Koblinger 2018-08-04 21:04:49 UTC
And while at it, my terminfo for xterm-256color contains

	smcup=\E[?1049h\E[22;0;0t, rmcup=\E[?1049l\E[23;0;0t

That is, the title is "automatically" saved and restored for "well-behaved" (terminfo-respecting) "fullscreen" (alternate screen) apps. I guess it's a pretty recent change, isn't it?
Comment 10 Egmont Koblinger 2018-08-04 21:26:46 UTC
The terminfo change is dated 2017-12-30.