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

CTRL -C event is closing the ConsoleZ window instead of returning to a prompt #262

Closed
Sheparzo opened this issue Aug 25, 2015 · 28 comments
Closed
Labels

Comments

@Sheparzo
Copy link

I expect the CTRL -C event to kill the currently running process and return to a bash prompt. Instead the CTRL -C event is closing the whole window with the latest version of Git for Windows (git version 2.5.0.windows.1).

@ericblade
Copy link

There's something really weird going on in the new bash and other tools that come with git. I have that bash as a shell in my ConsoleZ, and the first time I tried to Ctrl-C a command in it, I don't remember what command, it returned me to the bash prompt, then immediately to the cmd.exe prompt. Which is really weird because there shouldn't -be- a cmd.exe running underneath it, but apparently there is. And then I pressed enter a couple of times, and discovered that my keyboard input was going to both a bash and cmd.exe that were running in the same window somehow.
Very strange stuff. I'm not real happy with this git "upgrade".

@cbucher
Copy link
Owner

cbucher commented Aug 26, 2015

https://github.com/cbucher/console/wiki/How-to-Report-an-Issue

@Sheparzo
Copy link
Author

When I try a CTRL C from the hidden console at view console the issue does not occur. It will just stop the running process and return to a command prompt.
hidden-console

When I try CTRL C from git bash directly, the issue does not occur. It too will just stop the running process and return to the command prompt.
gitbash

The issue only occurs from ConsoleZ and it will close the window (or tab if there are multiple tabs) and it will leave the bash.exe process running. I always have multiple bash.exe processes left running even after I have hit CTLR C on their ConsoleZ windows and ConsoleZ is no longer running:
processes

I'm not sure if this a problem with ConsoleZ or with the git bash that gets installed with Git for Windows. Sorry if I've posted to the wrong place.

Diagnostic Report:

ConsoleZ aero amd64 1, 14, 0, 15129
is elevated? no
UAC prefix "Administrator: "
Tab: Git Bash
  View (active): 2. Git Bash - MINGW64:/d/Apps/ConsoleZ
  is elevated? no
font index: 6
face name: 
font familly: 48 MODERN
font weight: 400
font size: width=8 height=12
max window size: cols=132 rows=88
Tab: Git Bash
  View (active): 1. Git Bash - MINGW64:/d/Apps/ConsoleZ
  is elevated? no
font index: 6
face name: 
font familly: 48 MODERN
font weight: 400
font size: width=8 height=12
max window size: cols=132 rows=88
Tab (active): Git Bash
  View (active): 3. Git Bash - MINGW64:/d/Apps/ConsoleZ
  is elevated? no
font index: 6
face name: 
font familly: 48 MODERN
font weight: 400
font size: width=8 height=12
max window size: cols=132 rows=88
Monitors 2
  Flags 0
  DeviceID \\?\DISPLAY#LGD02DA#5&82107c&1&UID512#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}
  DeviceKey \Registry\Machine\System\CurrentControlSet\Control\Class\{4d36e96e-e325-11ce-bfc1-08002be10318}\0003
  DeviceName \\.\DISPLAY1\Monitor0
  DeviceString Generic PnP Monitor
  StateFlags 3
  Rect (1920,0)x(3840,1080)
  Work (1920,0)x(3840,1080)
  Flags 1  primary
  DeviceID \\?\DISPLAY#DELD028#5&82107c&1&UID519#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}
  DeviceKey \Registry\Machine\System\CurrentControlSet\Control\Class\{4d36e96e-e325-11ce-bfc1-08002be10318}\0018
  DeviceName \\.\DISPLAY2\Monitor0
  DeviceString Dell P2310H(Digital)
  StateFlags 3
  Rect (0,0)x(1920,1080)
  Work (0,0)x(1920,1080)
Settings file C:\Users\Jeremy\AppData\Roaming\Console\console.xml
<?xml version="1.0"?>
<settings>
    <console change_refresh="10" refresh="100" rows="25" columns="80" buffer_rows="500" buffer_columns="0" shell="" init_dir="" start_hidden="0" save_size="0" background_text_opacity="255">
        <colors background_text_opacity="255">
            <color id="0" r="0" g="0" b="0"/>
            <color id="1" r="0" g="0" b="128"/>
            <color id="2" r="0" g="150" b="0"/>
            <color id="3" r="0" g="150" b="150"/>
            <color id="4" r="170" g="25" b="25"/>
            <color id="5" r="128" g="0" b="128"/>
            <color id="6" r="128" g="128" b="0"/>
            <color id="7" r="192" g="192" b="192"/>
            <color id="8" r="128" g="128" b="128"/>
            <color id="9" r="0" g="100" b="255"/>
            <color id="10" r="0" g="255" b="0"/>
            <color id="11" r="0" g="255" b="255"/>
            <color id="12" r="255" g="50" b="50"/>
            <color id="13" r="255" g="0" b="255"/>
            <color id="14" r="255" g="255" b="0"/>
            <color id="15" r="255" g="255" b="255"/>
        </colors>
        <cursor style="0" r="255" g="255" b="255"/>
        <background type="0" r="0" g="0" b="0">
            <image file="" relative="0" extend="0" position="0">
                <tint opacity="0" r="0" g="0" b="0"/>
            </image>
        </background>
    </console>
    <appearance>
        <font name="Courier New" size="10" bold="0" italic="0" smoothing="0" bold_intensified="0" italic_intensified="0" extra_width="0" ligature="0">
            <color use="0" r="0" g="0" b="0"/>
        </font>
        <window title="ConsoleZ" icon="" use_tab_icon="1" use_console_title="0" show_cmd="1" show_cmd_tabs="1" use_tab_title="1" trim_tab_titles="20" trim_tab_titles_right="0" main_title_format="?U([%u] )?N({%u} )%m?s( - %s)" tab_title_format="%n. ?U([%u] )?N({%u} )%t?s( - %s)"/>
        <controls show_menu="1" show_toolbar="1" show_statusbar="1" show_tabs="1" hide_single_tab="1" show_scrollbars="1" flat_scrollbars="0" tabs_on_bottom="0" hide_tab_icons="0" show_searchbar="1"/>
        <styles caption="1" resizable="1" taskbar_button="1" border="1" inside_border="2" tray_icon="1" quake_like="0" jumplist="0" integrated_ime="0" quake_animation_time="300" hide_when_inactive="0">
            <selection_color r="255" g="255" b="255"/>
        </styles>
        <position x="-1" y="-1" dock="-1" snap="-1" z_order="0" save_position="0" w="-1" h="-1" save_size="0"/>
        <transparency type="0" active_alpha="255" inactive_alpha="255" r="0" g="0" b="0"/>
        <fullscreen start_in_fullscreen="0" fullscreen_monitor="0"/>
    </appearance>
    <behavior>
        <copy_paste copy_on_select="0" clear_on_copy="1" no_wrap="1" trim_spaces="1" copy_newline_char="0" sensitive_copy="1" include_left_delimiter="0" include_right_delimiter="0" left_delimiters=" ([" right_delimiters=" )]" eol_spaces="1" rtf="1"/>
        <scroll page_scroll_rows="0"/>
        <tab_highlight flashes="3" stay_highligted="1"/>
        <close allow_closing_last_view="0" confirm_closing_multiple_views="1"/>
        <focus follow_mouse="0"/>
        <instance allow_multi="1"/>
        <clone use_current_dir="0"/>
        <search match_case="0" match_whole_word="0"/>
        <runas use_credprov="1"/>
    </behavior>
    <hotkeys use_scroll_lock="1">
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="83" command="settings"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="112" command="help"/>
        <hotkey ctrl="0" shift="0" alt="1" extended="0" code="115" command="exit"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="112" command="newtab1"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="113" command="newtab2"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="114" command="newtab3"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="115" command="newtab4"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="116" command="newtab5"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="117" command="newtab6"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="118" command="newtab7"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="119" command="newtab8"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="120" command="newtab9"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="121" command="newtab10"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="122" command="newtab11"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="123" command="newtab12"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="49" command="switchtab1"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="50" command="switchtab2"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="51" command="switchtab3"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="52" command="switchtab4"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="53" command="switchtab5"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="54" command="switchtab6"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="55" command="switchtab7"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="56" command="switchtab8"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="57" command="switchtab9"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="48" command="switchtab10"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="9" command="nexttab"/>
        <hotkey ctrl="1" shift="1" alt="0" extended="0" code="9" command="prevtab"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="87" command="closetab"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="82" command="renametab"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="1" code="34" command="nextview"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="1" code="33" command="prevview"/>
        <hotkey ctrl="0" shift="0" alt="1" extended="1" code="37" command="leftview"/>
        <hotkey ctrl="0" shift="0" alt="1" extended="1" code="39" command="rightview"/>
        <hotkey ctrl="0" shift="0" alt="1" extended="1" code="38" command="topview"/>
        <hotkey ctrl="0" shift="0" alt="1" extended="1" code="40" command="bottomview"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="dechsize"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="inchsize"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="decvsize"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="incvsize"/>
        <hotkey ctrl="1" shift="1" alt="0" extended="0" code="87" command="closeview"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="detachview"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="attach"/>
        <hotkey ctrl="1" shift="1" alt="0" extended="0" code="79" command="splithoriz"/>
        <hotkey ctrl="1" shift="1" alt="0" extended="0" code="69" command="splitvert"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="clone"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="122" command="fullscreen"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="96" command="zoom100"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="107" command="zoominc"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="109" command="zoomdec"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="71" command="groupall"/>
        <hotkey ctrl="1" shift="1" alt="0" extended="0" code="71" command="ungroupall"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="84" command="grouptab"/>
        <hotkey ctrl="1" shift="1" alt="0" extended="0" code="84" command="ungrouptab"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="clear"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="1" code="45" command="copy"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="0" code="65" command="selectall"/>
        <hotkey ctrl="1" shift="0" alt="0" extended="1" code="46" command="clear_selection"/>
        <hotkey ctrl="0" shift="1" alt="0" extended="1" code="45" command="paste"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="stopscroll"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollrowup"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollrowdown"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollpageup"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollpagedown"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollcolleft"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollcolright"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollpageleft"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollpageright"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="find"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="findnext"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="findprev"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="switchtransparency"/>
        <hotkey ctrl="1" shift="1" alt="0" extended="0" code="112" command="dumpbuffer"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="cmdMenu1"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="cmdMenu2"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="cmdMenu3"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="ctrlC"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="externalcmd1"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="externalcmd2"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="externalcmd3"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="externalcmd4"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="externalcmd5"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="externalcmd6"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="externalcmd7"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="externalcmd8"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="externalcmd9"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="externalcmd10"/>
        <hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="activate" win="0"/>
    </hotkeys>
    <mouse>
        <actions>
            <action ctrl="0" shift="0" alt="0" button="1" name="copy"/>
            <action ctrl="0" shift="1" alt="0" button="1" name="select"/>
            <action ctrl="0" shift="0" alt="0" button="0" name="select_column"/>
            <action ctrl="0" shift="0" alt="0" button="3" name="paste"/>
            <action ctrl="1" shift="0" alt="0" button="1" name="drag"/>
            <action ctrl="0" shift="0" alt="0" button="4" name="link"/>
            <action ctrl="0" shift="0" alt="0" button="2" name="menu"/>
            <action ctrl="0" shift="0" alt="0" button="0" name="menu2"/>
            <action ctrl="0" shift="0" alt="0" button="0" name="menu3"/>
        </actions>
    </mouse>
    <tabs>
        <tab title="ConsoleZ" use_default_icon="0">
            <console shell="" init_dir="" priority="2" run_as_user="0" user="" net_only="0" run_as_admin="0"/>
        </tab>
        <tab title="Git Bash" use_default_icon="0">
            <console shell="D:\Apps\Git\bin\sh.exe --login -i" init_dir="" priority="2" run_as_user="0" user="" net_only="0" run_as_admin="0"/>
        </tab>
    </tabs>
    <external_commands>
</external_commands>
</settings>

@Sheparzo
Copy link
Author

I'm seeing now that this has already been reported: issue #230. There have been several related issues opened in the git-for-windows repo.

There are some helpful comments here in pull request #205 in git-for-windows.

@mriehema
Copy link

mriehema commented Sep 3, 2015

But there is still no solution, right? I'm confused after reading so many duplicated, closed tickets.

@Sheparzo
Copy link
Author

Sheparzo commented Sep 7, 2015

@mriehema, I am using the following settings and my CTRL-C is working. I haven't encountered any breaking functionality with this, however @dscho warns that there may be issues with this (git-for-windows/git#205 (comment)).

untitled

untitled

@cbucher cbucher added the how to? label Sep 8, 2015
@mriehema
Copy link

mriehema commented Sep 8, 2015

@Sheparzo Thanks! The settings of the Environment was missing in my setup. So CTRL-C is working now, but my aliases in .bashrc, .bash_profile are missing (located in $HOME). :(
And CTRL-L / clear is'nt working anymore too.

@dscho
Copy link

dscho commented Sep 8, 2015

@mriehema that's because of the issues I commented on in the other thread: hacking the environment variables (i.e. trying to out-guess the compatibility redirector in /bin/bash.exe) is never going to work in the long run. You would always have to play catch-up with the settings of that compatibility redirector (such as setting TERM and HOME, which you forgot here).

As I stated elsewhere: the proper fix will be to find out what exactly is going wrong with /bin/bash.exe and fixing that. (Without breaking everybody else's Git for Windows, of course.)

@dlong500
Copy link

@cbucher the pull request you made (git-for-windows/git#205) is closed without resolution due to apparent problems. Is there any more development on this issue that will actually let us use ConsoleZ with the latest Git/bash?

@dscho
Copy link

dscho commented Sep 28, 2015

the pull request you made (git-for-windows/git#205) is closed without resolution due to apparent problems.

@dlong500 Yes, it was closed because there was no indication that my concerns would be addressed. In particular, if I had merged that PR, my setup would have been broken. If you are interested in this issue, why don't you pick up the ball and open a new Pull Request?

@dlong500
Copy link

@dscho I certainly am interested in the issue. However, I don't have the expertise required to fix it myself (nor do I have the time to gain such knowledge). Wish I did. That shouldn't mean I can't ask if there is any progress being made considering the issue is a showstopper for anyone wanting to use ConsoleZ with the latest Git/bash versions.

@KrekkieD
Copy link

Does anyone know the latest version of git-for-windows that does not have this issue?

Also, what is this TERM=xterm variable? xterm is not a recognized command when I try to execute that ($ xterm), but not sure that's a problem (since MSYSTEM is also not executable for me ($ MINGW64)).

@cbucher
Copy link
Owner

cbucher commented Oct 22, 2015

@KrekkieD There is an easy workaround: configure a well coded shell (which doesn't terminate when receive CTRL-C) in ConsoleZ tab settings.

Try: cmd.exe /C "git-cmd.exe"

git-cmd.exe will terminate, but ConsoleZ monitors cmd.exe and cmd.exe will survive.

@KrekkieD
Copy link

Is there a bash.exe or sh.exe equivalent for that?

@billyc
Copy link

billyc commented Nov 20, 2015

An easy workaround: change your Console shell command to the following:

C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files\Git\usr\bin\bash.exe" --login -i"

@jeremydyoung
Copy link

I wasn't using ConsoleZ, but Console2 and ran into this same problem.

The problem was present with:

C:\Program Files\Git\bin\sh.exe --login -i

But it was NOT present with:

C:\Program Files\Git\usr\bin\sh.exe --login -i

One of the suggestions above has a screenshot with this difference, but I wanted to provide clarifying feedback that there does appear to be a difference in behavior between bin\sh.exe and usr\bin\sh.exe.

There does not seem to be any difference in behavior between the sh.exe in a folder and the bash.exe in a particular folder. Namely, bin\bash.exe behaves the same as bin\sh.exe, and usr\bin\bash.exe behaves the same as usr\bin\sh.exe

Hopefully this is useful to someone.

@billyc
Copy link

billyc commented Nov 24, 2015

@jeremydyoung i wish there was a +1 button. That's useful.

@ghost
Copy link

ghost commented Dec 1, 2015

With C:\Program Files\Git\usr\bin\sh.exe --login -i my shortcuts didnt worked but it did with C:\Program Files\Git\usr\bin\bash.exe --login -i

@AlexZeitler
Copy link

@jeremydyoung This did the trick! Thanks 👍

@mbenson
Copy link

mbenson commented Jan 29, 2016

/usr/bin/sh.exe avoids the Ctrl-C issue, all right, but seems not to invoke .bash_profile. Anybody have a solution to do both?

@cbucher
Copy link
Owner

cbucher commented Jan 30, 2016

@mbenson see here

@yoshiwaan
Copy link

tl;dr for people that are looking to just have a bash environment in Windows using Git for Windows then use the bash.exe version at C:\Program Files\Git\usr\bin\bash.exe

I upgraded to the latest git for windows (2.7.1.2-64) and consolez and started to get this problem, and I found out a little more information to add to the comment by @jeremydyoung above

C:\Program Files\Git\bin\bash.exe and C:\Program Files\Git\usr\bin\bash.exe are flat out not the same thing. The former is 31KB and seems to be basic Mingw64 bash and the latter is 2014KB and appears to be MSYS2 bash. The Mingw64 version also sets quite a few more environment variables.

C:\Program Files\Git\bin\bash.exe

yoshiwaan@local MINGW64 ~
$ uname
MINGW64_NT-6.1

C:\Program Files\Git\usr\bin\bash.exe

yoshiwaan@local  ~
$ uname
MSYS_NT-6.1

Who knows what the actual uses for each are from the Git for Windows perspective, but clearly the two executables are different, have different ctrl+c handling, may have different compilation options and the environment variables also may add different eventualities into the mix, after all this is an environment created for Git for Windows.

For people wanting a more pure bash + git on Windows I would say it's probably worth trying to just install MSYS2 by itself and use pacman (the Arch Linux package manager that MSYS2 uses) to install git. I'm pretty sure that will work but I've not tested. See general package management here: https://sourceforge.net/p/msys2/wiki/MSYS2%20installation/

For those happy to just use the bash in Git for Windows then use the MSYS2 version. If you want to load profiles properly in the same vein as when SSHing onto a remote server then pass the --login -i options to bash.exe or sh.exe, which affect the type of shell created. This isn't anything to do with MSYS, Git for Windows or Mingw64, just basics of how the login system of these shells work. See this diagram for more of an idea of how this works : https://shreevatsa.files.wordpress.com/2008/03/bashstartupfiles1.png

@dscho
Copy link

dscho commented Feb 14, 2016

tl;dr You Can't Believe Most Of What You Read On The Internet (A. Lincoln)

for people that are looking to just have a bash environment in Windows using Git for Windows then use the bash.exe version at C:\Program Files\Git\usr\bin\bash.exe

This is flawed advice, as I pointed out earlier already.

The former is 31KB and seems to be basic Mingw64 bash

This is incorrect. /bin/bash.exe refers to a redirector that sets up some environment variables and then hands off to /usr/bin/bash.exe. This redirector was only invented for backwards compatibility, but apparently is needed for eternity.

To sum it up: /bin/bash.exe is not the Bash, but relies on /usr/bin/bash.exe to do the hard lifting.

@yoshiwaan
Copy link

@dscho thanks for better explaining about the wrapper. It makes sense.
I don't think my advice is bad as of this time (Git for Windows 2.7.1) because your options right now are:

  • Use git-bash.exe and just use the mintty that comes with Git for Windows
  • Use C:\Program Files\Git\bin\bash.exe and have Ctrl+C kill your window
  • Use C:\Program Files\Git\usr\bin\bash.exe and have issue due to unset environment variables, which I'm not clearn on what issues will cause other than Vim time being wrong

Of the above if you want to use ConsoleZ then you have to choose the lesser of two evils, of which the latter is better (IMO). Hopefully there's a fix soon for the redirector, more and more these days I wish I knew C. Might be time to bite the bullet.

git-for-windows/git#205 has a lot more info for anyone interested.

@dscho
Copy link

dscho commented Feb 15, 2016

your options right now are:
[...]

You forgot one, rather crucial, option, the one option I would have prefered:

  • work with @dscho on a real fix.

All it would need would be a person dedicated to driving the fix. Whatever knowledge is missing, I can provide, but not the time nor the incentive.

more and more these days I wish I knew C

No one was born with knowledge of C. Chances are that you were exposed to some language similar enough to C, such as Javascript, Ruby, etc. Besides, you only need to imitate the surrounding code. And you are totally allowed to ask questions!

@BiggerNoise
Copy link

@dscho - I have some (dusty) C knowledge, and can probably take a look at this some time this week.

Can you point me in the direction that you think would be a good place to start? Thanks.

@dscho
Copy link

dscho commented Apr 4, 2016

@BiggerNoise could you first try with Git for Windows v2.8.1? It might be fixed in the meantime...

@BiggerNoise
Copy link

Yes, that appears to have done it. My C skills remain safely locked away.

I am starting the shell with "C:\Program Files\Git\bin\bash.exe" and no arguments.

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

No branches or pull requests