Skip to content

gh pr create -w doesn't print absolute URI to stdout #9470

@heaths

Description

@heaths

Describe the bug

When you run gh pr create -w it prints a URI without the scheme:

To https://github.com/owner/repo.git
 * [new branch]          HEAD -> branch
branch 'branch' set up to track 'origin/branch'.
Opening github.com/owner/repo/compare/main...branch in your browser.

If the browser isn't opened automatically - as is the case by default in WSL without something like wslview installed - you can't Ctrl+Click the URI because it doesn't have a scheme.

Steps to reproduce the behavior

  1. In WSL without wslview, or without wslview set the old hack export BROWSER=explorer.exe.
  2. Run gh pr create -w
  3. Windows Explorer opens - not the browser - and the URI in the stdout message above isn't clickabke, at least in VSCode's integrated terminal (which is conpty that Windows Terminal uses as well).

Expected vs actual behavior

Like many (most?) other commands, the scheme should be prefaced before the URI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-prrelating to the gh pr commandhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions