-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
git-bash doesn't start in home folder on windows #794
Comments
Try using there is a different file system philosophy between Windows and *nix. Windows has drives (plural) while *nix has root (singular). So on G4W, a locally particular folder is chosen as the root directory, which depends on which bash exe you run. The SDK's bash and the program files bash can have different roots! |
|
That is quite some time ago: 59d5f43 If you want it to open in the home directory, call it with |
At least, my memories were right :) Thx, that worked. |
On my little netbook (XP!), I see (it's not on-net at the moment), with the two different bashes, Philip@po MINGW32 ~ Philip@po MINGW32 ~ SDK recent: Philip@po MINGW32 / Philip@po MINGW32 / Philip@po MINGW32 / note the two different root directories! |
@ausminternet yep, but there was no official Git for Windows version with that behavior. In other words: it was fixed before the first official release of Git for Windows 2.x.
@PhilipOakley Have you called if test -f /etc/profile.d/git-sdk.sh
then
TITLEPREFIX=SDK-${MSYSTEM#MINGW}
else
TITLEPREFIX=$MSYSTEM
fi |
@dscho I completely reloaded the SDK on the 7th June. (A previous attempt a couple of months ago at I moved/renamed my personal /git dir so I could bring it back without having lots of config hassles, deleted the old SDK and rebuilt afresh. Then put back my /git and made sure it was up to date. When I install, I normally use the bash only install option. (and it's XP 32 bit ;-) I had noticed that the PS prompt wasn't the same as the regular program files bash window, but too many other life issues to search it down. |
@dscho, Was going to ask the dumb question: how do you get the git-extra package version? but Google saved me before I hit 'comment'.
meanwhile you said
so it looks as if it's up to date. |
So you see the |
From: Johannes Schindelin
Unfortunately no. Even after a restart. The titlebar is still just "/" at startup of the bash, with a prompt of Philip@PhilipOakley MINGW32 / (colouring is approx green, purple, orange, with my colour settings) Philip |
Can you verify that |
Hi @dscho , I'm at a bit of a loss in how to debug this (*nix start up) stuff, e.g. determining which actual scripts are being sourced. side thoughts: Does/should the git-prompt.sh need a shebang line? Did manage to add an 'echo xxx' at L#8 of the git-prompt scripts and can see they are both executing at startup. |
@dscho I think this http://superuser.com/a/886247/596154 (competing title settings set in other PS1 settings) may have some useful insights. I don't have enough time at the moment to pursue it much further, but maybe later. I may trigger an 'Aha' moment for you. |
Yes.
Maybe you set your PS1 in
I typically debug this by inserting a |
I've found c:\git-sdk-32\etc\bash.bashrc#L44-46 would appear to have the PS1 line that's showing up in my SDK window. It appears to be conditional on MSYS2_PS1 existing . I'll try and play with that. I'll try the -x trick now you've prompted me. After posting I realised that TITLEPRFIX must be working, 'cos the other (progam file/git) window was working - sometimes one can't see the blindingly obvious... |
@dscho, I tweaked the c:\git-sdk-32\etc\bash.bashrc#L42-47 and can confirm that the displayed prompt (with the SDK bash) is the default one from there, while that piece of code is missing from the C:\Program Files\ version. (see the extra "Hi-" before the $MSYSTEM ;-)
I haven't started looking at how that file is 'created/fetched' during the SDK install yet, nor if we should simply define an extra |
I've just done a fresh full install of the SDK, and of Git 2.9.0, on my wife's W7 home office PC, and it has exactly the same issue. The How do I determine which package it was that loaded the I'm thinking it was one of the many pacman installs. |
You mean "installed" by "loaded"? If so, it is $ pacman -Qo /etc/bash.bashrc
/etc/bash.bashrc is owned by filesystem 2016.05-3 |
Thanks, sorry about the jotd (jargon of the day ;-) misunderstanding . I did eventually find that invocation, and the follow up
I've then had a look at the what I believe is the msys2-base package at So I'm still unsure which package or patch owns that particular version of the file. Any pointers on how to detect, during the install, if the file has been updated? PS: should this be moved/copied to a fresh issue? |
Usually I prefer this. With active and responsive contributors, I am of course trying to accommodate ;-) |
Not a fix, but adding this snippit to ~/.bash_profile seems to reliably work around the issue for me without the side effect of breaking Git Bash Here. I'm using tje 2.9.0 64-bit installer release on Windows 7.
This approach breaks down, of course, if you actually want to begin in the root directory. That's been exceedingly rare in my case, however. |
I still think this is the correct solution. FWIW my Git for Windows v2.9.0 64-bit's Git Bash opens in the home directory, as it should. The shortcut installed into the start menu uses that |
The shortcut does indeed include the Personally, I like to assign a key sequence to the shortcut in cases like this. In my case Ctrl-Alt-G invokes the program menu shortcut from anywhere, with the relevant parameter included. |
Same here, my git-bash defaults to home dir because of the |
@landstander668 That's exactly right! 😄 |
6e6310d (filesystem: New specific variable MSYS2_PS1., 2016-05-01) introduced the MSYS2_PS1 prompt script proriority to allow multiple device configurations. Unfortunately it overwrote the $PS1, even when specifically set by the users configuration, such as the Git-for-Windows SDK see git-for-windows/git#794 (comment) and the monkey patch fix git-for-windows/build-extra#122. Introduce a priority order so that the user's $PS1 (if set) has an intermediate priority between the MSYS2_PS1 and the default PS1. Signed-off-by: Philip Oakley <philipoakley@iee.org>
6e6310d (filesystem: New specific variable MSYS2_PS1., 2016-05-01) introduced the MSYS2_PS1 prompt script proriority to allow multiple device configurations. Unfortunately it overwrote the $PS1, even when specifically set by the users configuration, such as the Git-for-Windows SDK see git-for-windows/git#794 (comment) and the monkey patch fix git-for-windows/build-extra#122. Introduce a priority order so that the user's $PS1 (if set) has an intermediate priority between the MSYS2_PS1 and the default PS1. Signed-off-by: Philip Oakley <philipoakley@iee.org>
6e6310d (filesystem: New specific variable MSYS2_PS1., 2016-05-01) introduced the MSYS2_PS1 prompt script priority to allow multiple device configurations. Unfortunately, if MSYS2_PS1 was not set it overwrote the $PS1, even when specifically set by the users configuration, such as provided in the Git-for-Windows SDK (see git-for-windows/git#794 (comment)) and the monkey patch fix (git-for-windows/build-extra#122). Introduce a priority order so that the user's $PS1 (if set) has an intermediate priority between the MSYS2_PS1 and the default PS1. Signed-off-by: Philip Oakley <philipoakley@iee.org>
FWIW I had this problem too, because of user error:
The right way to pin it to the taskbar is to right-click the desktop icon and select "Pin to Taskbar" there. |
Marius, you have two 'taskbar's in there (step 3 and step 5). It may need a little extra clarification between the pinned and unpinned icons within the "taskbar".Philip FWIW I had this problem too, because of user error:
The right way to pin it to the taskbar is to right-click the desktop icon and select "Pin to Taskbar" there. — |
Ran into this exact problem after installing v2.30.0 of GitBash on Win10. |
Hi there,
I'm using git for windows, version 2.9.0 in 64-bit. I'm not really sure, but in my memories the git-bash opened in the users home folder some time ago (c/users/username on windows 7).
The current version (and the last few versions, too) are opening the git-bash in root (/) and not in my user-folder.
Is this a bug, a feature, or are my memories wrong?
If my memories are wrong:
Configuring the .bash_profile to go to the home folder when it opens up breaks the "open git bash here" option, so is there a way to configure the git-bash to open up in home folders and not breaking the "open git bash here" option?
Greets, Jan
The text was updated successfully, but these errors were encountered: