mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix(agent): start rpty lifecycle after all reads/writes (#15535)
Fixes https://github.com/coder/internal/issues/214 #15475 missed that we also write to `rpty` after starting `rpty.lifecycle()`. This PR moves the function call right at the end. Hopefully this should address the data races before we go resorting to mutexes.
This commit is contained in:
@ -78,8 +78,6 @@ func newScreen(ctx context.Context, cmd *pty.Cmd, options *Options, logger slog.
|
||||
}
|
||||
rpty.id = hex.EncodeToString(buf)
|
||||
|
||||
go rpty.lifecycle(ctx, logger)
|
||||
|
||||
settings := []string{
|
||||
// Disable the startup message that appears for five seconds.
|
||||
"startup_message off",
|
||||
@ -124,6 +122,8 @@ func newScreen(ctx context.Context, cmd *pty.Cmd, options *Options, logger slog.
|
||||
return rpty
|
||||
}
|
||||
|
||||
go rpty.lifecycle(ctx, logger)
|
||||
|
||||
return rpty
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user