From 23a08e46042cfca730f54522b60e3d69a245270a Mon Sep 17 00:00:00 2001 From: Thomas Klaeger Date: Sun, 18 Oct 2015 22:31:36 +0200 Subject: [PATCH] git-gui (Windows): use git-bash.exe if it is available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Git for Windows 2.x ships with an executable that starts the Git Bash with all the environment variables and what not properly set up. It is also adjusted according to the Terminal emulator option chosen when installing Git for Windows (while `bash.exe --login -i` would always launch with Windows' default console). So let's use that executable (usually C:\Program Files\Git\git-bash.exe) instead of `bash.exe --login -i` if its presence was detected. This fixes https://github.com/git-for-windows/git/issues/490 Signed-off-by: Thomas Kläger Signed-off-by: Johannes Schindelin --- git-gui/git-gui.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index 0787c10fcd..494ad612fe 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -2691,10 +2691,18 @@ if {![is_bare]} { } if {[is_Windows]} { + # Use /git-bash.exe if available + set normalized [file normalize $::argv0] + regsub "/mingw../libexec/git-core/git-gui$" \ + $normalized "/git-bash.exe" cmdLine + if {$cmdLine != $normalized && [file exists $cmdLine]} { + set cmdLine [list "Git Bash" $cmdLine &] + } else { + set cmdLine [list "Git Bash" bash --login -l &] + } .mbar.repository add command \ -label [mc "Git Bash"] \ - -command {eval exec [auto_execok start] \ - [list "Git Bash" bash --login -l &]} + -command {eval exec [auto_execok start] $cmdLine} } if {[is_Windows] || ![is_bare]} {