Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 5b66ca4

Browse files
committed
Cleanup
1 parent c68b7e4 commit 5b66ca4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cmd/coder/shell.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ func sendResizeEvents(ctx context.Context, termfd int, process wsep.Process) {
5252
resizeLimiter := rate.NewLimiter(rate.Every(time.Millisecond*100), 1)
5353

5454
for {
55+
if ctx.Err() != nil {
56+
return
57+
}
5558
width, height, err := terminal.GetSize(termfd)
5659
if err != nil {
5760
flog.Error("get term size: %v", err)
@@ -141,13 +144,8 @@ func runCommand(ctx context.Context, envName string, command string, args []stri
141144
defer stdin.Close()
142145
io.Copy(stdin, os.Stdin)
143146
}()
144-
145147
go io.Copy(os.Stdout, process.Stdout())
146148
go io.Copy(os.Stderr, process.Stderr())
147149

148-
err = process.Wait()
149-
if err != nil {
150-
return err
151-
}
152-
return nil
150+
return process.Wait()
153151
}

0 commit comments

Comments
 (0)