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

can't attach new Git For Windows 2.0 #176

Closed
phazei opened this Issue Jun 5, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@phazei

phazei commented Jun 5, 2015

I'm running the new Windows Git 2.0 release candidate. It uses msys2 and mintty.

If I open git bash, and try to attach window it throws an error as attached. With the previous version of windows git, when I ran git bash, it automatically attached to conemu, a feature I'd like to re-enable.

I also installed msys2 stand alone and that does attach. Also when I open msys2, it always opens a cmd window that gets attached to conemu that just says press any key to close, not problematic though.
EDIT: actually, msys2 stopped attaching as well, not sure what changed.

conemubug

@phazei

This comment has been minimized.

phazei commented Jun 5, 2015

In trouble shooting it I realized conemu and mintty are both terminals. So it was a bit redundant. Not sure if it should work that way or not. Though when WinGit2 replaces the current one, I'm sure many more people will run into this issue.

I'm not sure how git-bash.exe is launching it, but I just created a shortcut file that kind of matched that msys did when it fell bash to sh:

C:\Windows\System32\cmd.exe /A /C C:\msysGit\usr\bin\bash --login -i

and that seems to work fine. Don't know if there are any special env variables that are important to set, like MSYSTEM, MSYS, or anything else.

Oh, I also had to change in /etc/profile :

export TERM=cygwin

It was export TERM=xterm-256color but that had issues clearing the screen when opening nano. I tried TERM=linux and a couple others, but cygwin seemed to work cleanest.

@Maximus5

This comment has been minimized.

Owner

Maximus5 commented Jun 5, 2015

Calling cmd.exe before bash is absolutely excessive. Look how ConEmu creates default tasks when you run ConEmu.exe -basic.

Also, there was an issue in git-for-windows
git-for-windows/git#96 (comment)

@landstander668

This comment has been minimized.

landstander668 commented Jun 5, 2015

I'm able to successfully attach git-bash.exe from the Git 2.4.2.1 release candidate, by using the following task command in ConEmu (details originally found here and here):

"%ProgramFiles%\Git\git-bash.exe" --needs-console --no-hide --minimal-search-path --command=usr\\bin\\bash.exe --login -i -new_console:t:"Git Bash":C:"%ProgramFiles%\Git\mingw64\share\git\git-for-windows.ico"

The only quirk is that this actually creates 2 tabs... one for git-bash.exe, which is effectively hung for the duration, and a second for the console window which it creates. Thus far, I haven't found any way around the multiple tabs.

@Maximus5, is it possible to make ConEmu hide a tab (without showing the original, hidden console window)? If so, that would likely be a usable workaround.

@landstander668

This comment has been minimized.

landstander668 commented Jun 5, 2015

I should have added that the following task command works, at least for the time being, without the multiple-tab side effect.

set MSYSTEM=MINGW64 & "%ProgramFiles%\Git\usr\bin\bash.exe" --login -i -new_console:t:"Git Bash":C:"%ProgramFiles%\Git\mingw64\share\git\git-for-windows.ico"

I'd prefer to avoid this approach, however, since git-bash.exe may perform additional setup which causes this method to break in future.

@Maximus5

This comment has been minimized.

Owner

Maximus5 commented Jun 5, 2015

I haven't decided yet which behavior or switches would be correct for running git-bash.exe. This tool is compiled as GUI application but it starts console window, may be improperly. Perhaps I will create pull request for git-for-windows later.

@Maximus5

This comment has been minimized.

Owner

Maximus5 commented Jun 10, 2015

Preferred way to run git-for-windows is using git-cmd.exe

c:\git\git-cmd.exe --command=usr/bin/bash.exe -l -i

@Maximus5 Maximus5 closed this Jun 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment