sorenlouv / backport

A simple CLI tool that automates the process of backporting commits on a GitHub repo
https://github.com/sqren/backport/blob/main/docs/config-file-options.md
Apache License 2.0
241 stars 57 forks source link

providing terminal editor during conflicts hangs the process #499

Closed kapral18 closed 1 month ago

kapral18 commented 1 month ago

when providing editor like nano or (n)vim during a cherry pick conflict resolution I never get to the listing of files to resolve

it hangs one step before.

image

And waits for a stdin input, which is understandable because nvim as any terminal editor is operating in interactive mode and expecting stdin to be continuously fed.

Since child_process.spawns default stdio option is pipe it creates an indirection layer between parent and child pipes, making nvim or any other editor hang disconnected while waiting for any input.

One way of fixing this would be to add stdio: inherit to spawn, to remove the unnecessary pipe layer and connect child process to parent io pipes.

I already tested it and it indeed works. Let me know wdyt.

Thanks

sorenlouv commented 1 month ago

Hi @kapral18

I already tested it and it indeed works. Let me know wdyt.

Can you open a PR? Don't worry about failing test, I'll gladly help out with that.