Bug 976515 - System Bashrc Destroys Screen Title
System Bashrc Destroys Screen Title
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: screen (Show other bugs)
21
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Hracek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-20 13:44 EDT by Solly Ross
Modified: 2015-12-02 11:04 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-01 21:48:31 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Solly Ross 2013-06-20 13:44:21 EDT
Description of problem:
The default bashrc file contains the lines

      if [ -e /etc/sysconfig/bash-prompt-screen ]; then
          PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
      else
          PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
      fi

The PROMPT_COMMAND variable there indicates to screen that it should draw the title of the screen "window" dynamically.  However, this seems to obliterate any title set by launching screen with the `-t` flag, which breaks certain scripts, such as devstack (and essentially removes the ability to set a title from the command line).
Comment 1 Ondrej Vasik 2013-06-21 07:15:53 EDT
Just to be sure, is this really the request for some screen change or change in setup (and /etc/bashrc)? PROMPT_COMMAND for screen changed recently - it was definitely wrong, but the new behaviour seems to be not very accepted by some screen users. This change was requested by https://bugzilla.redhat.com/show_bug.cgi?id=969429 and discussion is there. If you have any proposal, how to improve it, feel free to suggest it - anyway the old escape sequence was imho wrong (it was cut&paste issue from xterm).
Comment 2 Gilboa Davara 2013-07-10 07:43:12 EDT
Can I somehow force screen to ignore PROMPT_COMMAND?

- GIlboa
Comment 3 Ondrej Vasik 2013-07-10 08:03:17 EDT
PROMPT_COMMAND will not be ignored, but you can easily set it yourself. If you have /etc/sysconfig/bash-prompt-screen with some content, it will be used instead of the default PROMPT_COMMAND in /etc/bashrc . If you set the PROMPT_COMMAND in ~/.bashrc yourself, it will have higher priority than the one from /etc/bashrc - so you can set it to the old one - PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' (which is wrong - and because of the invalid sequence, the screen ignored this PROMPT_COMMAND even though the effect was expected to be the same as in the case of xterm - so user@hostname:PWD ...
Comment 4 Gilboa Davara 2013-07-11 03:25:49 EDT
Actually, I tried setting up PROMPT_COMMAND in ~/.bashrc (TERM = "screen*") but it doesn't seem to last.
However, at least as far as I can see, placing an empty /etc/sysconfig/bash-prompt-screen (+x) prevents screen from trashing the existing screen title and replacing it with PROMPT_COMMAND.

- Gilboa
Comment 5 Aristeu Rozanski 2014-03-12 10:32:41 EDT
So, for a long time people who wanted their screen window title to change had to change their ~/.bashrc for that (and by now they have that set up) and now it changes the default so everyone else needs to do something to restore it? Why?

Case in point: I use screen for absolutely everything but bugzilla and I name each window with the BZ number I'm working on. Now I have to every machine I reserve in beaker to solve a problem to log in, make a change, log off, reset the
window title to the bz number to log in again.
Comment 6 Fedora End Of Life 2015-01-09 13:29:23 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 7 Gilboa Davara 2015-01-14 01:27:28 EST
Still an issue w/ F21.
Comment 8 Miroslav Vadkerti 2015-10-23 05:01:28 EDT
(In reply to Aristeu Rozanski from comment #5)
> So, for a long time people who wanted their screen window title to change
> had to change their ~/.bashrc for that (and by now they have that set up)
> and now it changes the default so everyone else needs to do something to
> restore it? Why?
> 
> Case in point: I use screen for absolutely everything but bugzilla and I
> name each window with the BZ number I'm working on. Now I have to every
> machine I reserve in beaker to solve a problem to log in, make a change, log
> off, reset the
> window title to the bz number to log in again.

Exactly my problem :( the only solution I see, and that would make both worlds happy, is to have screen be able to ignore PROMPT_COMMAND if requested.
Comment 9 Aristeu Rozanski 2015-10-23 08:02:32 EDT
(In reply to Miroslav Vadkerti from comment #8)
> Exactly my problem :( the only solution I see, and that would make both
> worlds happy, is to have screen be able to ignore PROMPT_COMMAND if
> requested.

I've long switched to tmux and I suggest you to do the same. Clearly making a
couple of people happy with this PROMPT_COMMAND being default is more important.

Contact me outside of bugzilla and I can help you make the switch too.
Comment 10 Fedora End Of Life 2015-11-04 05:03:30 EST
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 11 Fedora End Of Life 2015-12-01 21:48:35 EST
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.