Bug 969429
Summary: | PROMPT_COMMAND prints wrong escape code for screen | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Carl-Johan Schenström <cjs> |
Component: | setup | Assignee: | Ondrej Vasik <ovasik> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 22 | CC: | alex, bwalker, cjs, dan.mashal, jan.klepek, martin.bukatovic, masanari_iida, ovasik, rvokal, sanjay.ankur, srevivo, stefanrin, stephenf, sylvain.pasche |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | setup-2.8.71-1.fc19 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-07-19 10:13:51 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Attachments: |
Description
Carl-Johan Schenström
2013-05-31 12:01:50 UTC
Thanks for report - \033]0 is really wrong, will fix that in next update - in csh.cshrc I see \033_ ... is that wrong as well? I see it disputed e.g. in old gentoo thread - http://forums-lb.gentoo.org/viewtopic-t-334689-start-0.html and in several other discussions. \033_ sets the hardstatus, while \033k sets the caption, i.e. the title, on the screen windows. I'm fairly sure that captions are what we're after in this case. setup-2.8.71-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/setup-2.8.71-1.fc19 Package setup-2.8.71-1.fc19: * should fix your issue, * was pushed to the Fedora 19 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing setup-2.8.71-1.fc19' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-10339/setup-2.8.71-1.fc19 then log in and leave karma (feedback). Hi, Before this update, screen (via byobu) would start new windows with a blank name, which is what I assumed is to be done. The "user@host:$PWD" part was shown in the gnome-terminal window title, which also seems correct. Now, all new windows start with "user@host:$PWD" and keep changing according to pwd in the hardstatusline, not the gnome-terminal title bar. This seems wrong. Also incredibly cluttered. Gnome-terminal now just says "screen". Can you please confirm how it's supposed to work? I think the earlier behaviour made more sense really. I'm giving negative karma to the update for the time being. Thanks, Warm regards, Ankur Created attachment 758998 [details]
Screenshot showing previous terminal visuals.
Created attachment 759005 [details]
Screenshot showing terminal visuals after package update
This is working as expected on mate-terminal. Created attachment 759017 [details]
screen without byobu in xterm.
Created attachment 759018 [details]
screen without byobu in xterm after update.
It looks OK with plain screen. Is it Byobu issue then, or a terminal emulator issue? If someone can pin point where it's going weird, I can go run around file relevant bugs.
setup-2.8.71-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report. Just reopening until we figure out the issue. Will close it thereafter. I'm experiencing the same problem with screen-4.1.0-0.14.20120314git3c2946.fc19.x86_64 and setup-2.8.71-1.fc19.noarch Based on the report and change, I think this change is intentional, however - it seems that not all screen users are happy with the change. If I'm not missing something, screen now behaves the same way as xterm, with different escape codes. This is imho right way. Reporter - could you please react on the complaints? I'm not really sure what's the right way. Sorry, I haven't tried Byobu, so I can't really comment on that. Everything works as expected here on plain Screen, i.e. captions are set to "user@host:pwd" and are also used for terminal (xterm, gnome-terminal) titles. Since Byobu is an extension of Screen, I'd suspect it's interfering somehow. Maybe by changing the termcaps or the hardstatus string? Please note that F19 is no longer compatible with OpenStack's devstack script. This blocks all development of OpenStack on Fedora 19 hosts. For others that come across this bug in search ofa workaround, place the following in /etc/sysconfig/bash-prompt-screen: printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}" For the specific issue, this change breaks the -t flag to screen and interaction with the -p flag. A reproducer is as follows: screen -d -m -S stack -t shell -s /bin/bash screen -r stack -X hardstatus alwayslastline '%{= .} %-Lw%{= .}%> %n%f %t*%{= .}%+Lw%< %-=%{g}(%{d}%H/%l%{g})'^ After running screen -r, the hardstatus line should display the window name (bash) but instead is displaying the full path. This breaks how screen and -t operate with another in a way I don't entirely understand. This causes an operation like: screen -t key bash screen -S stack -p key -X stuff 'cd /opt/stack/keystone && /opt/stack/keystone/bin/keystone-all --config-file /etc/keystone/keystone.conf --log-config /etc/keystone/logging.conf -d --debug || touch "/opt/stack/status/stack/key.failure"^M' to fail because screen -p cannot be used to preselect a window name if the window name keeps changing and doesn't match the actual name of the window title. Steven, are you saying that OpenStack relies on the most probably wrong escape code in screen? I don't think that \033]0; is the right sequence. However, based on the response saying that this change in behaviour is not what the users expect, I'm not really sure if the current behaviour is the right one as well. Tcsh uses different one as well - as I mentioned in comment#1 - so screen prompt command handling definitely lacks consistency. It would be good to come with something what will be suitable for all users. Ondrej, Not OpenStack itself, but devstack, a tool used for OpenStack development. One thing I believe we can agree upon is that screen -t and screen -p should work with whatever PROMPT_COMMAND is used. They apparently rely on the escape codes for their functionality. I have no idea what should be the proper escape sequences (I don't know how escape sequences work in detail). One thing that may make sense is to look at escape sequences in other distros for the screen terminal type. Note for those looking for a working DevStack, the following devstack review works around the problem: https://review.openstack.org/#/c/35071/ (In reply to Carl-Johan Schenström from comment #2) > \033_ sets the hardstatus, while \033k sets the caption, i.e. the title, on > the screen windows. I'm fairly sure that captions are what we're after in > this case. I haven't been able to find a complete list to differentiate between 033]0; and 033k. 033]0; seems to be used to set the title of the terminal emulator window, as I found in quite a few posts: http://mg.pov.lt/blog/bash-prompt.html http://www.kirsle.net/blog/kirsle/set-window-title-in-bash http://hints.macworld.com/article.php?story=20031015173932306 Using 033k sets the gnome-terminal title as: [screen 0: user@host:pwd] while 033]0; sets it as: [screen 0: bash] user@host:pwd and using a hardstatus line with 033]0; sets the hardstatus line as "bash" while keeping setting the xterm window title as user@host:pwd. The previous behaviour seems to fit better IMO. I'm unclear on what the issue that prompted this change is. Can you please clarify? Thanks, Warm regards, Ankur (By previous, I mean using "033]0;" rather than the "033k") (In reply to Ankur Sinha (FranciscoD) from comment #20) > The previous behaviour seems to fit better IMO. I'm unclear on what the > issue that prompted this change is. Can you please clarify? (In reply to Ankur Sinha (FranciscoD) from comment #21) > (By previous, I mean using "033]0;" rather than the "033k") When using split regions in Screen, having the different regions called "bash" by default isn't very helpful. Especially not when logging in to remote machines and having it constantly reset. It would seem that setting the region captions, and let Screen propagate them to the terminal window title, is more user friendly. OTOH, that seems to break some things and confuse people. I want to point out that this affects other programs that use PROMPT_COMMAND such as tmux. With the new version the chosen window titles are so large that opening more than two is unwieldy. If the default needs to be changed to "033k" then so be it, but it would be nice if maybe we put a comment about it in /etc/bashrc so beginners can figure out how to revert to the previous behavior more easily. This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle. Changing version to '20'. More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20 This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle. Changing version to '20'. More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20 I'm currently discussing effect of this change with byobu upstream (ticket: 1197726, https://bugs.launchpad.net/byobu/+bug/1197726) anyway, it looks like this change is correct and issue might be somewhere in byobu. I have to agree with comment #23. This breaks all terminal multiplexers that show multiple window titles on a single line (tmux, byobu, screen with a custom caption string). I wonder if PROMPT_COMMAND should even be set when TERM=screen* Anyway, here's a quick workaround: sudo ln -s /usr/bin/true /etc/sysconfig/bash-prompt-screen This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle. Changing version to '22'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22 Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 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. This is broken again in Fedora 24 because screen does not seem to set TERM to "screen" anymore. Instead, "xterm-256color" is passed through. |