Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit29cbc54

Browse files
authored
Reconnecting PTY waits for command output or EOF (#7279)
Signed-off-by: Spike Curtis <spike@coder.com>
1 parentf1dfeb0 commit29cbc54

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

‎agent/agent.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,12 +1036,9 @@ func (a *agent) handleReconnectingPTY(ctx context.Context, logger slog.Logger, m
10361036
<-ctx.Done()
10371037
_=process.Kill()
10381038
}()
1039-
gofunc() {
1040-
// If the process dies randomly, we should
1041-
// close the pty.
1042-
_=process.Wait()
1043-
rpty.Close()
1044-
}()
1039+
// We don't need to separately monitor for the process exiting.
1040+
// When it exits, our ptty.OutputReader() will return EOF after
1041+
// reading all process output.
10451042
iferr=a.trackConnGoroutine(func() {
10461043
buffer:=make([]byte,1024)
10471044
for {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp