GNOME Bugzilla – Bug 699819
support title stacking (CSI 22 t / CSI 23 t)
Last modified: 2018-08-04 21:26:46 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.
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;
*** Bug 752514 has been marked as a duplicate of this bug. ***
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.
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.
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?
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.
Fixed on master. I went for dropping the bottommost stack entry instead.
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.
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?
The terminfo change is dated 2017-12-30.