From 79878a67365336b1b823c50c1ca7f15eddcedbe2 Mon Sep 17 00:00:00 2001 From: Cristian Dominguez Date: Mon, 9 Nov 2020 08:28:55 -0300 Subject: [PATCH] Show MousetrapHelpText when double-clicking gh.exe --- cmd/gh/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/gh/main.go b/cmd/gh/main.go index 354f5392b..d4abd2f74 100644 --- a/cmd/gh/main.go +++ b/cmd/gh/main.go @@ -64,9 +64,11 @@ func main() { } } - // Enable running gh from explorer.exe. Without this, the user is told to stop and run from a + // Enable running gh from Windows File Explorer's address bar. Without this, the user is told to stop and run from a // terminal. With this, a user can clone a repo (or take other actions) directly from explorer. - cobra.MousetrapHelpText = "" + if len(os.Args) > 1 && os.Args[1] != "" { + cobra.MousetrapHelpText = "" + } rootCmd := root.NewCmdRoot(cmdFactory, buildVersion, buildDate)