diff --git a/command/issue.go b/command/issue.go index 853c0dcd6..315ce6aac 100644 --- a/command/issue.go +++ b/command/issue.go @@ -353,7 +353,11 @@ func issueCreate(cmd *cobra.Command, args []string) error { url.QueryEscape(body), ) // TODO could exceed max url length for explorer - fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s in your browser.\n", openURL) + url, err := url.Parse(openURL) + if err != nil { + return err + } + fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s%s in your browser.\n", url.Host, url.Path) return utils.OpenInBrowser(openURL) } else if action == SubmitAction { params := map[string]interface{}{ diff --git a/command/pr_create.go b/command/pr_create.go index 085806b2b..a72dff7ff 100644 --- a/command/pr_create.go +++ b/command/pr_create.go @@ -148,11 +148,13 @@ func prCreate(cmd *cobra.Command, _ []string) error { url.QueryEscape(title), url.QueryEscape(body), ) - // TODO maybe do something about -d being discarded when previewing // TODO could exceed max url length for explorer - fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s in your browser.\n", openURL) + url, err := url.Parse(openURL) + if err != nil { + return err + } + fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s%s in your browser.\n", url.Host, url.Path) return utils.OpenInBrowser(openURL) - } else { panic("Unreachable state") }