-
Couldn't load subscription status.
- Fork 7.3k
Run commands from explorer.exe #2076
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
Conversation
The MousttrapHelpText will only be validated in cobra when running on windows.
|
@RozzaysRed As a non-windows user I am curious what is the use case for being able to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! But like @samcoe I would like to know if it's really worth to enable invoking gh from Explorer, since I can't imagine many use-cases. Also, is there a way to specifically detect when gh was run from Explorer, but still show a MousetrapHelpText when someone double-clicked on gh.exe to run it outside of a terminal?
pkg/cmd/root/root.go
Outdated
| ) | ||
|
|
||
| func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *cobra.Command { | ||
| cobra.MousetrapHelpText = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is modifying global cobra package state, I would advise moving it to cmd/gh/main.go instead of executing it as part of this function.
|
The use case is described in #1919 |
|
@rystaf That's an excellent suggestion. 👍 |
Any command run from explorer.exe in windows would open cmd with "This is a command line tool. You need to open cmd.exe and run it from there".
This pr allows gh commands to be run from windows explorer.
This fixes issue #1919