-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
decouple init
and start
#4
Conversation
@@ -3,13 +3,16 @@ | |||
|
|||
/* auto-generated by NAPI-RS */ | |||
|
|||
export interface Pid { | |||
pid: number | |||
} | |||
export interface Size { | |||
cols: number | |||
rows: number | |||
} | |||
export class Pty { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does napi-rs preserve comments? it would be neat to have a little warning in the docstring telling folks to always start reading from the FD before calling start
to avoid surprises.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, this file is auto-generated, not sure if we can inject comments into it
#4 added a lot of good CI improvements. Let's land them ASAP! This change takes #4 and only keeps the changes needed to fix CI and local Linux development. --------- Co-authored-by: Szymon Kaliski <[email protected]>
Currently starting the child process is tied to the
Pty
initialization, which can lead to a race condition like:Pty
which evaluatesecho 'hello'
-- this returnsfd
and starts the child process immediatelyms
fd
-- it is already invalid since the child exited!This PR decouples creating the
Pty
/fd
from actually starting the child -- the newcan start the process at an arbitrary later point in time
test shows how that works.This PR also pins the CI bun version to
1.0.26
which is what theflake.nix
is pinned to. I'll follow up with updatingbun
version in another PR.