Skip to content

Conversation

@kumavis
Copy link

@kumavis kumavis commented Nov 5, 2025

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I understand this is a bug tracker and anything other than a proven bug will be closed
  • I understand this is a free project and relies on community contributions
  • I read and understood the Contribution guide

bug

There are som limitations to an inherited stdin:

  • When the child process reads from stdin, the parent process also reading from stdin causes conflicts (race to read, only one reads).
  • When the child process sets the stdin mode to "raw mode", every key press seen by the parent (see race above) causes the parent to restart the child.

proposal

Add an option to disable the stdin reads for the reload check

The default was selected so as to not introduce a breaking change.
The flag name --reload-on-keypress(a bit inexact), was chosen to leave room for the reload triggering key to change via a future flag.

Relevant issues:

other notes

the child sharing a stdin adds some complications, as the child may expect a certain mode or change the mode. its possible to instead do set stdin to 'pipe' in the spawn config, set the parent in raw mode, and pipe input into the child. another alternative may be to give the child a pseudoterminal https://github.com/microsoft/node-pty
i haven't explored these options in depth

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant