Bug 1180283

Summary: bashrc should reflect new bash-4.3 behaviour to retain matching output
Product: [Fedora] Fedora Reporter: Chad Feller <cfeller>
Component: setupAssignee: Ondrej Vasik <ovasik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 21CC: admiller, ooprala, ovasik, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: setup-2.9.0-4.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-06 07:00:46 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 Flags
bashrc patch none

Description Chad Feller 2015-01-08 18:55:16 UTC
Description of problem:
I recently upgraded to Fedora 21 and noticed that in my Konsole window that what was usually 

  <user>@<host>:~ 

was now

  <user>@<host>:/home/<user>

thus "~" was replaced with the contents of the variable $HOME, or in other words, the explicit path of the users home directory.

This shouldn't be the case.  

In my Konsole settings my "Tab title format" as well as "Remote tab title format" is "%w", which, according to KDE is "Window title set by shell", and my shell is bash.

I've been using KDE since Fedora 15 and haven't seen this behavior until now.  The Konsole version between Fedora 20 and 21 is currently the same, so I don't think it is a Konsole bug, but the version of bash between Fedora 20 and Fedora 21 is different.

Furthermore, if I ssh into a Fedora 20 box, my window title reverts to the old (correct) behavior, but ssh'ing into a Fedora 21 box, I get the odd window title behavior, just as I see on my local machine.

Version-Release number of selected component (if applicable):
bash-4.3.30-2.fc21.x86_64

How reproducible:
always

Steps to Reproduce:
1. Open Konsole
2. Ensure the following settings: 
 - Settings -> Edit Current Profile -> Tabs -> Tab Title format = %w
 - Settings -> Edit Current Profile -> Tabs -> Remote tab Title format = %w

Actual results:
home directory displayed as absolute path

Expected results:
home directory displayed as "~"


Additional info:

Comment 1 Chad Feller 2015-01-08 19:00:26 UTC
I should also note, that within my shell that my bash prompt properly displays "~" when I am in my home directory.  It is just what it is exporting to the terminal window (in this case Konsole), is incorrect.

Comment 2 Chad Feller 2015-01-08 19:42:37 UTC
I was able to confirm the same behavior when SSH'ing in from Mac OS X.  

Opening a Terminal.app window (on OS X) and SSH'ing to a Fedora 21 box will set the path portion of the window title in the same way (expanded absolute path), whereas SSH'ing into a Fedora 20 box sets the window title the correct way (with a "~" for the home directory).

Comment 3 Chad Feller 2015-01-08 19:48:08 UTC
Final note: the same behavior can be observed on a regular xterm window, as well.

Comment 4 Ondrej Oprala 2015-01-14 14:50:58 UTC
Thanks for the heads up, this is caused by an intentional change in bash-4.3, so the code in /etc/bashrc gives a different result.
Since we provide the /etc/bashrc file via the setup package, I'll reassign. 

To setup guys:
Please find attached a patch for bashrc.
The only change is an escaped tilde which now correctly gets expanded. However, the bashrc code relies on the old behaviour.

Comment 5 Ondrej Oprala 2015-01-14 14:51:48 UTC
Created attachment 980047 [details]
bashrc patch

Comment 6 Ondrej Vasik 2015-01-14 14:56:38 UTC
Thanks for reassign and patch, Ondrej.

Comment 7 Fedora Update System 2015-02-23 15:16:44 UTC
setup-2.9.0-4.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/setup-2.9.0-4.fc21

Comment 8 Fedora Update System 2015-02-25 13:27:06 UTC
Package setup-2.9.0-4.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing setup-2.9.0-4.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-2502/setup-2.9.0-4.fc21
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2015-03-06 07:00:46 UTC
setup-2.9.0-4.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.