-
Notifications
You must be signed in to change notification settings - Fork 639
git-prompt.sh: remove duplicate space when $MSYSTEM not set #625
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
Conversation
Signed-off-by: David Refoua <[email protected]>
Signed-off-by: David Refoua <[email protected]>
|
To quote the old PR:
None of this has been addressed.
PS1="$PS1${MSYSTEM:+\[\033[35m\]$MSYSTEM }" # show MSYSTEM in purpleYes, that's what Johannes also suggested, in the same review comment on the old PR. |
This is as true as it has been then. Why is it not set in your setup? Are you maybe using an unsupported scenario (but even there, |
|
Thanks for taking time reviewing this case. 1. Regarding commit message
I'll change the commit message to attempt to comply with the instructed link above. Hopefully, the new commit message is acceptable. 2. Regarding scripting syntax
Sure, if using a one liner is prefered, I'll change the commit to reflect this as well. Which one should I keep? 3. Regarding the actual need for this change
As I've explained in the old PR, the root cause is as follows:
As for your other important observation:
This problem has existed for as long as I can remember (assuming it's reproduced using the example I've provided above). When I opened the previous PR, I was using the official installation, without any modifications. Now, I'm in fact using the unsupported scenario as it's described, but I don't believe it's relevant to this issue. To make sure, I'll install a fresh version to ensure that this is true. Once done, I'll explain the problem in more detail and hopefully you'll be able to repro it. Additionally, please decide whether to keep the current implementation, or change it to the one-liner one. I'll also update the commit message to comply with the instructed link above. Once again, thank you for taking time to consider this issue. I'll post an update with the fresh installation and repro steps soon. |
To reiterate, whatever your entry point into Git for Windows, whether that be If you try to use Git for Windows as a kind of distribution of Bash, that's not really what this project is all about. Having said that, what you really are looking for is MSYS2. Git for Windows leverages MSYS2 and ships with a subset of its files. MSYS2 even sports a package management system called "pacman" to install more tools (including Git...), so why don't you give it a whirl? |
Repro steps
Here are the results for each:
|
Do note that this was not in the list of supported entry points I provided. You are asking for an undue maintenance burden here by insisting to not run the Bash profile. The Git for Windows project does not enjoy a large number of people helping with maintenance, therefore I cannot, and do not want to, fulfill your wish. |
|
I will also have to note that what you illustrated is a use case where you want an interactive Bash on Windows. This here project isn't called "Bash on Windows", though. It's called "Git for Windows", for a good reason, as I pointed out earlier. |
Well, that's how the Cmder project has always been structured, as the MSYS2 package is larger in size, and I believe it lacks Git support. https://github.com/cmderdev/cmder I believe dropping GfW to replace it with unmodified MSYS2 to solve minor issues such as this may not be the best approach to do.
Hopefully #625 (comment) will show how this is not true. Please note that I used Windows sandbox (a clean VM) to try this out; I believe you'll also see the same results if you install and launch the actual bash binary (located at
I understand, and I agree. You are completely correct, however, I'm hoping that GfW could also be open to be useful for projects and use cases like this. Git bash is a useful and acceptable utility to be used for these projects. Additionally, it seems acceptable to use it in the way that I've outlined above. I'm not asking to support this entry, I'm just asking to consider minor issues that can be benefited from PRs such as this one. |
I hope that this isn't too much of a burdon; for reference we've been using the The
Hopefully I can be more useful and help with the maintenance in those regards. We've been enjoying the GfW package in the Cmder project, and as a long time maintainer, it's only fair to contribute back where possible.
In any case, thanks for the time to consider this. Please note, I'm against asking to support a new un-supported entry for bash, or to expect a "Bash for Windows" feature being provided by GfW. I understand that you guys are already time and effort constrained, and this isn't the point of the PR to begin with. I would just like to ask for a minor change in the I started this PR because I assume the "Git bash" feature that GfW provides is a valid use case, and I would prefer to address issues such as this one at the upstream project, instead of modifying it downstream. Once again, sorry for any distresses caused, and thank you for considering this case. |
|
I'm hoping that by applying patches such as this, we would be able to stop relying on downstream patches that are intended to address minor cosmetic issues such as this one. Update: Since this is now closed, the accepted alternative is to patch the |





Signed-off-by: David Refoua [email protected]
This PR removes a duplicated (double space) in the first line of the PS1 prompt when the
$MSYSTEMvariable is not set.This is mainly the result of the bash login profile not being called when bash is executed, which results in the variable NOT being set. Here's an example:
As you see, there are two spaces instead of one. This PR replaces the older (now closed) #472.
Alternatively, something like this one liner can also be used, as suggested before:
Please consider adding this PR as we use GfW in the Cmder project, and the invocation used may not always load the profile, hence the missing MSYSTEM variable.