File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -114,10 +114,10 @@ func (r *RootCmd) ssh() *clibase.Cmd {
114114 if err != nil {
115115 return err
116116 }
117- watchAndClose := func (c io. Closer ) {
117+ watchAndClose := func (closer func () error ) {
118118 // Ensure session is ended on both context cancellation
119119 // and workspace stop.
120- defer c . Close ()
120+ defer closer ()
121121
122122 for {
123123 select {
@@ -145,7 +145,7 @@ func (r *RootCmd) ssh() *clibase.Cmd {
145145 return err
146146 }
147147 defer rawSSH .Close ()
148- go watchAndClose (rawSSH )
148+ go watchAndClose (rawSSH . Close )
149149
150150 go func () {
151151 // Ensure stdout copy closes incase stdin is closed
@@ -170,7 +170,11 @@ func (r *RootCmd) ssh() *clibase.Cmd {
170170 return err
171171 }
172172 defer sshSession .Close ()
173- go watchAndClose (sshSession )
173+ go watchAndClose (func () error {
174+ _ = sshSession .Close ()
175+ _ = sshClient .Close ()
176+ return nil
177+ })
174178
175179 if identityAgent == "" {
176180 identityAgent = os .Getenv ("SSH_AUTH_SOCK" )
You can’t perform that action at this time.
0 commit comments