-
Notifications
You must be signed in to change notification settings - Fork 494
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
Bash update 4.3.046 breaks PS1 environment variable #653
Comments
Also, workaround to get prompt back to how it was is to run:
which will add the prompt to the end of your .bashrc file. This is found at C:\msys64\home[username] assuming you installed the 64bit version in the default directory. |
So, there was a change in /etc/bash.bashrc where this:
was changed to this:
|
@ukhf-jm Thank you for the analysis. I authoured the minor fix #651 to a previous fix that broke the Git for Windows SDK's bash title bar settings part of the PS1. (more details on that link) Any input on putting together a proper fix that covers typical user settings would be gratefully recieved (I'm an engineer who mainly works on Windows so the fine details of bash set ups is not something I normally deal with ;-) |
I'm also affected by this. It seems like this change was originally made to support Git4Windows settings its own PS1. However, where was that previous prompt set from? It shouldn't be possible for anything to run before the system-wide profile files. Is Git for Windows setting the PS1 via an exported environment variable? |
@yuriks, No (original==G4W?). This (my small #651) change was because the previous patch 6e6310d had broken the G4W SDK. These two commits must be taken as a pair, and each of the different backstories surfaced and considered, including @renatosilva's original rationale (the logic back then may have been incomplete). |
Just tried a fresh install again and can confirm prompt is as expected after updating bash. Thank you @Alexpux , @Karlson2k and @PhilipOakley |
@ukhf-jm Thanks for report! |
In 73e06b9 (bash.bashrc: Update PS1 if PS1 wasn't exported. Closes msys2#653, 2016-07-14), we updated `/etc/bash.bashrc` to avoid overriding `PS1`, but the way it was done requires `cut.exe` to be in the `PATH`. Now, while _most_ of the time we're running inside a login Bash where the `PATH` has been appropriately modified, sometimes we don't. In that case, `cut.exe` is not in the `PATH`. We should not spawn a new process, anyway, as spawning processes is really expensive in the MSYS2 runtime because of all the contortions necessary to emulate the POSIX syscall `fork()`. Let's just avoid that extra process by using `case`, which is a Bash built-in and therefore won't cost much time to run. This fixes git-for-windows/git#3652 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In 73e06b9 (bash.bashrc: Update PS1 if PS1 wasn't exported. Closes msys2#653, 2016-07-14), we updated `/etc/bash.bashrc` to avoid overriding `PS1`, but the way it was done requires `cut.exe` to be in the `PATH`. Now, while _most_ of the time we're running inside a login Bash where the `PATH` has been appropriately modified, sometimes we don't. In that case, `cut.exe` is not in the `PATH`. We should not spawn a new process, anyway, as spawning processes is really expensive in the MSYS2 runtime because of all the contortions necessary to emulate the POSIX syscall `fork()`. Let's just avoid that extra process by using `case`, which is a Bash built-in and therefore won't cost much time to run. This fixes git-for-windows/git#3652 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In 73e06b9 (bash.bashrc: Update PS1 if PS1 wasn't exported. Closes msys2#653, 2016-07-14), we updated `/etc/bash.bashrc` to avoid overriding `PS1`, but the way it was done requires `cut.exe` to be in the `PATH`. Now, while _most_ of the time we're running inside a login Bash where the `PATH` has been appropriately modified, sometimes we don't. In that case, `cut.exe` is not in the `PATH`. We should not spawn a new process, anyway, as spawning processes is really expensive in the MSYS2 runtime because of all the contortions necessary to emulate the POSIX syscall `fork()`. Let's just avoid that extra process by using `case`, which is a Bash built-in and therefore won't cost much time to run. This fixes git-for-windows/git#3652 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
After updating bash, user's prompt is set to
PS1=\s-\v\$
whereas previously it was set toPS1="\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$"
.Fairly easy to fix if you know where to look although new users may struggle.
What else may have been affected by the update?
Compiling in the Win64 MinGW-w64 shell appears to still work fine but it's not clear what files the bash update changed and how they changed.
Would this have broken prompts for people who had customised theirs?
The text was updated successfully, but these errors were encountered: