Skip to content

body not correctly passed to browser on "preview in browser" PR action #270

@fluffynuts

Description

@fluffynuts

Version & environment info

gh: version 0.5.1 (2020-01-28)
os: windows 10

(note that gh --version reports a source url of https://github.com/github/homebrew-gh/releases/latest at the end, which is odd to see on a windows platform, especially considering that I downloaded the .msi from https://github.com/cli/cli/releases, but this is minor)

Describe the bug

First time using gh here, so please bear with me.

I performed a gh pr create in my repo and was guided through the process. After editing the PR body in an external editor, I selected to "preview in browser" -- mainly because I want to assign code reviewers. However, the command failed to populate the body of the PR and produced an error (I gather it's from attempting to exec a command)

Steps to reproduce the behavior

  1. gh pr create
  2. fill in title
  3. external editor for body
  4. "What's next" => "preview in browser"
  5. error in console ("'body' is not recognized as an internal or external command")
  6. browser tab opens with title populated and no body
  7. Appending "&body=some stuff" to the url appends the body, so I have to assume this could be a quoting issue when spawning the browser open under the covers?

Expected vs actual behavior

I expected to get a PR started up for me with the body intact. Also, now that this has failed, it would be nice if the gh command stored the body somewhere so I don't have to retype it -- there are other reasons this command might fail (eg network failure).

Logs

C:\code\codeo\codeo.core [fix-build-errors-at-ci ≡]> gh pr create

Creating pull request for fix-build-errors-at-ci into master in codeo-za/codeo.core

? Title fix build errors at CI
? Body <Received>                             
? What's next? Preview in browser                   
Opening github.com/codeo-za/codeo.core/compare/master...fix-build-errors-at-ci in your browser.
'body' is not recognized as an internal or external command,
operable program or batch file.
cmd: exit status 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions