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

Commit 7cdd51c

Browse files
committed
Close stdin on end of os stdin
1 parent bc640b3 commit 7cdd51c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: cmd/coder/shell.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ func (cmd *shellCmd) Run(fl *pflag.FlagSet) {
111111
go cmd.sendResizeEvents(termfd, wc)
112112
}
113113

114-
go io.Copy(wc.Stdin, os.Stdin)
114+
go func(){
115+
defer wc.Stdin.Close()
116+
io.Copy(wc.Stdin, os.Stdin)
117+
}()
115118
go io.Copy(os.Stdout, wc.Stdout)
116119
go io.Copy(os.Stderr, wc.Stderr)
117120

0 commit comments

Comments
 (0)