Skip to content

gh pr create breaks on fish #7634

Description

@laulauland

Describe the bug

Using the latest gh version: gh version 2.31.0 (2023-06-20)

Whenever I run gh pr create the interactive workflow breaks after attempting to add description with my default editor - nvim.

Here's the shell output:

? Title My PR title
? Body [(e) to launch nvim, enter to skip]
X operation failed. To restore: gh pr create --recover /var/folders/x1/j43x6m8x5md0y8lc_n9d22zw0000gn/T/gh4294673773.json

could not prompt: exit status 134

Note: I wasn't able to reproduce this on zsh suggesting that this might be related how the CLI interfaces with fish shell that I'm normally using

Steps to reproduce the behavior

  1. In fish with nvim as default editor, type this gh pr create
  2. Add title in the form, and select e to open in editor nvim when prompted for a description.
  3. nvim opens fine and I can add the description correctly, howeve...
  4. Once the description is saved and nvim is closed the interactive workflow breaks with exit status 134

Expected vs actual behavior

Expected: worfklow continues allowing me to submit the PR

Actual: workflow breaks with exit status 134

Logs

? Title My PR title
? Body [(e) to launch nvim, enter to skip]
X operation failed. To restore: gh pr create --recover /var/folders/x1/j43x6m8x5md0y8lc_n9d22zw0000gn/T/gh4294673773.json

could not prompt: exit status 134

Activity

  1. williammartin commented on Jun 27, 2023

    @williammartin
    Member

    HI @keturiosakys, thanks fro the report and sorry that you are experiencing issues.

    Just a couple of questions to start:

    1. Did this change between earlier versions and the current version?
    2. Separately from gh, when you're using nvim in fish does it function correctly when saving and exiting?
  2. williammartin commented on Jun 27, 2023

    @williammartin
    Member

    I just installed fish and used nvim to go through these steps successfully:

    williammartin@William-GitHub-Laptop ~/w/c/test-repo (triage-7634)> ps -p $fish_pid
      PID TTY           TIME CMD
    23829 ttys006    0:00.85 fish
    
    williammartin@William-GitHub-Laptop ~/w/c/test-repo (triage-7634)> EDITOR=nvim gh pr create
    ? Where should we push the 'triage-7634' branch? williammartin/test-repo
    
    Creating pull request for triage-7634 into main in williammartin/test-repo
    
    ? Title triage 7634
    ? Body <Received>
    ? What's next? Cancel
    Discarding.
  3. vilmibm commented on Jun 27, 2023

    @vilmibm
    Contributor

    I'm also unable to reproduce this. What is the value of EDITOR in the fish shell? I suspect the problem is there.

  4. laulauland commented on Jun 27, 2023

    @laulauland
    Author

    Hey thanks for responding both! To answer the questions:

    1. Yes this behavior started to occur with a recent upgrade of gh I believe, although I can't currently pinpoint which exact version
    2. Separately nvim works correctly withfish
    3. The value of EDITOR is nvim

    Let me try running nvim without a config and see if I can reproduce this error.

  5. laulauland commented on Jun 27, 2023

    @laulauland
    Author

    Yyyep can't reproduce it anymore - my bad!

    CleanShot 2023-06-27 at 22 51 45@2x

    Happy to close the issue - I'll dig around my config to see if I can find what in there caused the earlier errors

  6. achimnol commented on Jul 1, 2023

    @achimnol

    Maybe a same/similar issue: #7651.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageneeds to be reviewed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions