diff --git a/cmd/gh/main.go b/cmd/gh/main.go index 31e90d3fb..57af7b966 100644 --- a/cmd/gh/main.go +++ b/cmd/gh/main.go @@ -176,6 +176,12 @@ func mainRun() exitCode { printError(stderr, err, cmd, hasDebug) + if strings.Contains(err.Error(), "Incorrect function") { + fmt.Fprintln(stderr, "You appear to be running in MinTTY without pseudo terminal support.") + fmt.Fprintln(stderr, "To learn about workarounds for this error, gh help mintty") + return exitError + } + var httpErr api.HTTPError if errors.As(err, &httpErr) && httpErr.StatusCode == 401 { fmt.Fprintln(stderr, "hint: try authenticating with `gh auth login`") diff --git a/pkg/cmd/root/help_topic.go b/pkg/cmd/root/help_topic.go index 2b4abe12c..90f157c6b 100644 --- a/pkg/cmd/root/help_topic.go +++ b/pkg/cmd/root/help_topic.go @@ -6,6 +6,12 @@ import ( ) var HelpTopics = map[string]map[string]string{ + "mintty": { + "short": "Information about using gh with MinTTY", + "long": heredoc.Doc(` + TODO + `), + }, "environment": { "short": "Environment variables that can be used with gh", "long": heredoc.Doc(`