From 076a73696a8cdf1515f5327200dbd4a30d5652cc Mon Sep 17 00:00:00 2001 From: Thomas Klaeger Date: Sun, 18 Oct 2015 22:31:36 +0200 Subject: [PATCH] git-gui: Use /git-bash.exe if available On Windows using /git-bash.exe is preferable over using bash because /git-bash.exe respects the users preferred terminal --- 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 ce167d4b42..0290a45808 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -2667,10 +2667,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]} {