diff --git a/agent/reconnectingpty/screen.go b/agent/reconnectingpty/screen.go index c6d56aa220d4b..3fc93d88102f8 100644 --- a/agent/reconnectingpty/screen.go +++ b/agent/reconnectingpty/screen.go @@ -67,8 +67,6 @@ func newScreen(ctx context.Context, cmd *pty.Cmd, options *Options, logger slog. timeout: options.Timeout, } - go rpty.lifecycle(ctx, logger) - // Socket paths are limited to around 100 characters on Linux and macOS which // depending on the temporary directory can be a problem. To give more leeway // use a short ID. @@ -80,6 +78,8 @@ 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",