-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path shortening is not working in bash 4.3 #289
Comments
Fixes issue liquidprompt#289 The solution was described in https://lists.gnu.org/archive/html/bug-bash/2014-03/msg00044.html I had to remove the double quotes. I have no problem with spaces characters in directories. I hope it is OK.
I also have the same problem on Debian testing. I don't think that using the compatibility mode is the correct long term solution. |
as ecksun pointed out this simple patch is neither working in bash 4.2 nor in zsh https://github.com/JForst/liquidprompt/commit/995dcaca530fe13066aa8843cc5aead58ab06595 |
I had not tested with bash 4.2. Only with bash 3.2.51 on Mac OS X. Your check is only for bash 4.3. The behaviour will change again with bash 4.4? Or should we use |
As I understand the discussion on http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00036.html this is a fix for a bug (first answer in the discussion). my check is for major number 4 and minor >= 3, so any release of 4 should work. Maybe we should also consider major number >=4 |
I miss-readed your check, sorry. You are right. According to another email in the same thread https://lists.gnu.org/archive/html/bug-bash/2014-03/msg00044.html using |
I think you are right, I do understand this a <=bash-4.2 and >=bash-4.3 but on my MAC-OS with an older version of the bash, this does not work. [forst:'~'] $ bash --version Maybe it is best to keep it with >=bash-4.3, since there where no problems But the name of the variable _LP_SHELL_bash43 is clearly misleading. Maybe |
If the variable name is [[ $bmajor -ge 4 && $bminor -ge 3 ]] Just to be clear, is this a bug only in bash 4.2? in bash > 4.2 we should be using the escaped version? If so, I would like to rewrite my patch somewhat as the code now suggest that it is bash >=4.3 that does is buggy. |
The check must be smarter than that or bash version 5.0 to 5.2 will not detected correctly. |
You are right but I would rather do |
As said before, I think we shouldn't change the behavior which worked
just breaks: e.g
or this:
|
How does it break? Note that the code I proposed is: You must remove the double quotes " " or you get the single quotes ' ' in the result. |
Oh, sorry - my fault! you are right. your code is working on my bash3.2 versions. |
Please check what happens when $PWD contains spaces... |
It works with spaces in directory names:
|
Pattern substituion in bash 4.2 was faulty, which caused tilde to not be expanded in certain cases. This behaviour was previously relied on, now we are only using that behaviour as a fallback on bash 4.2. This resolves issue liquidprompt#289
Pattern substituion in bash 4.2 was faulty, which caused tilde to not be expanded in certain cases. This behaviour was previously relied on, now we are only using that behaviour as a fallback on bash 4.2. This resolves issue liquidprompt#289
Pattern substituion in bash 4.2 was faulty, which caused tilde to not be expanded in certain cases. This behaviour was previously relied on, now we are only using that behaviour as a fallback on bash 4.2. This resolves issue #289
Pattern substituion in bash 4.2 was faulty, which caused tilde to not be expanded in certain cases. This behaviour was previously relied on, now we are only using that behaviour as a fallback on bash 4.2. This resolves issue liquidprompt#289 Conflicts: liquidprompt
I'm trialing liquidprompt on bash 4.3.30 on OS X 10.10 and it seems like I am seeing this same behaviour -- when I'm in a directory under my home directory, I don't get the path shortened with a tilde. It looks like the solutions discussed in this thread weren't adopted? I can see liquid prompt in head still shows |
The fix should be in the develop branch, I have been using that for quite some time without issues. However I'm not sure how the release-schedule looks like for liquidprompt, it was a while since master was touched. |
If I stand in my home directory or any child thereof the path to my home is not shortened to ~
The reason for this is a change in how bash handles expansion in pattern substitutions:
http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00036.html
The incorrect behavior is because of:
located here:
https://github.com/nojhan/liquidprompt/blob/master/liquidprompt#L539
I can think of two ways of fixing this for bash 4.3:
However neither works on bash 4.2, I also do not know how to deal with zsh.
One could also probably use compability mode:
shopt -s compat42
or simply check for the bash version currently used.
I do not mind implementing the fix, however I do not know how to do it in a clean manner so suggestions are welcome.
The text was updated successfully, but these errors were encountered: