Skip to content
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 shortcut not opening Git-Bash console #2597

Open
1 task done
ben-sandham opened this issue Apr 23, 2020 · 6 comments
Open
1 task done

Git-Bash shortcut not opening Git-Bash console #2597

ben-sandham opened this issue Apr 23, 2020 · 6 comments

Comments

@ben-sandham
Copy link

ben-sandham commented Apr 23, 2020

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
    64-bit
$ git --version --build-options

git version 2.26.2.windows.1
cpu: x86_64
built from commit: 4267c88d0d8936ae723bba55e0576b1c4f3d4e1a
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
    Windows 10 64-bit
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.18363.778]
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"

Editor Option: VIM
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: ConHost
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Not that I am aware.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

C:\Program Files\Git>git-bash.exe

Launches git console.

Git Bash Application Icon

  • Application shortcut targets: "C:\Program Files\Git\git-bash.exe" --cd-to-home
  • But I can navigate to C:\Program Files\Git\bin\bash.exe which will open a console

I can change where the application target is, but I just want to ensure that my setup is not causing issues down the line.

  • What did you expect to occur after running these commands?

N/A

  • What actually happened instead?

N/A

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

N/A

@PhilipOakley
Copy link

Wild quick guess: do check the release notes regarding winpty and terminal windows https://github.com/git-for-windows/build-extra/blob/master/ReleaseNotes.md#known-issues, given that link contains "setup-earth-analytics-python". (I haven't looked at those instructions)

Also check dscho's clarification at #2594 (comment) as I maybe way off the mark.

@rimrul
Copy link
Member

rimrul commented Apr 24, 2020

@PhilipOakley , I think you're a little off the mark here. They said they use the "Use Windows’ default console window" option, so the winpty things don't apply. They basically already did what dscho suggests in the comment you linked. The winpty issue would also manifest in a different way. The Git-Bash window would show up and issues would only appear after calling python from within that window. This is something else.

@benjamin-sandham do I read this part correctly?

C:\Program Files\Git>git-bash.exe

Launches git console.

Launching git-bash.exe from within the C:\Program Files\Git folder using cmd.exe does show the Git bash window, but clicking the shortcut doesn't?

But I can navigate to C:\Program Files\Git\bin\bash.exe which will open a console

Yeah, that isn't quite the same as git-bash.exe.

Application shortcut targets: "C:\Program Files\Git\git-bash.exe" --cd-to-home

That does sound correct. That's exactly what my working Git Bash shortcut targets on multiple systems. It says

Start in: %HOMEDRIVE%%HOMEPATH%
Shortcut key: None
Run: Normal window

below that. The shortcut file also has "Read" and "Read, execute" NTFS permissions granted to "Users" and "Everyone".

Could you check the permissions on your shortcut and try the following in cmd.exe?

%HOMEDRIVE%
cd %HOMEDRIVE%%HOMEPATH%
C:\Program Files\Git\git-bash.exe

@ben-sandham
Copy link
Author

ben-sandham commented Apr 24, 2020

@rimrul
Navigating to

cd %HOMEDRIVE%%HOMEPATH%

Gives path
C:\Users\bsand>
And executing
"C:\Program Files\Git\git-bash.exe"

Opens a bash console window. I had to use quotation marks as the following was occurring

C:\Program' is not recognized as an internal or external command,
operable program or batch file.

My shortcut properties display the following:

Start in: %HOMEDRIVE%%HOMEPATH%
Shortcut key: None
Run: Normal window

My shortcut file also has "Read" and "Read, execute" NTFS permissions granted to "Users" and "Everyone".

@rimrul
Copy link
Member

rimrul commented Apr 24, 2020

Yeah, the missing quotation marks where my mistake. That looks good, too. sounds like an issue with --cd-to-home. could you check echo %HOME%?

@ben-sandham
Copy link
Author

C:\Users\bsand>echo %HOME%
%HOME%

Would you be able to explain the difference between bash.exe and git-bash.exe? I can set the application shortcut file to "C:\Program Files\Git\bin\bash.exe" which will then allow me to click the icon and open a console window, but I don't fundamentally understand the difference between the two.

@rafrafek
Copy link

rafrafek commented Sep 9, 2021

It looks similar to "Open Windows Terminal here" issue with Windows Terminal:
microsoft/terminal#8933 (comment)

I have also experienced weird behavior when opening Git Bash by "Git Bash Here" (with right mouse click inside directory) - repository configuration was not being loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants