Screen version 4.06.02 (GNU) 23-Oct-17

After setting up Dynamic Window Titles
<https://www.gnu.org/software/screen/manual/html_node/Dynamic-Titles.html#Dynamic-Titles>,
it is not possible to change the title of a window. The new name is
overwritten after the next prompt writes the null title escape sequence.

For example, with this in the .screenrc (or equivalent
environment settings):
shelltitle '$ |bash'

And using bash with this in .bashrc (or equivalent environment settings):
PS1= '$ '
PROMPT_COMMAND='printf "\033k\033\134"'

Then we get dynamic window titles in screen that shows the current running
process or "bash". However, if I want to rename the current window to
"production" with (C-a A) or `title` then the window gets the title
"production" but the next prompt erases it and restores it to bash.

I could change PROMPT_COMMAND to stop outputting the escape but what I
really want is to set the new title to `$ |production:` so that the title
is production:<cmd>. Removing the escape sequence doesn't help here and
with it the title is overridden.

This seems like a bug.

I had originally asked about this here:
https://stackoverflow.com/questions/78866987/how-to-manually-set-a-windows-title-in-gnu-screen-while-using-dynamic-window-ti

Reply via email to