File tree 1 file changed +8
-4
lines changed
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 {
114
114
if err != nil {
115
115
return err
116
116
}
117
- watchAndClose := func (c io. Closer ) {
117
+ watchAndClose := func (closer func () error ) {
118
118
// Ensure session is ended on both context cancellation
119
119
// and workspace stop.
120
- defer c . Close ()
120
+ defer closer ()
121
121
122
122
for {
123
123
select {
@@ -145,7 +145,7 @@ func (r *RootCmd) ssh() *clibase.Cmd {
145
145
return err
146
146
}
147
147
defer rawSSH .Close ()
148
- go watchAndClose (rawSSH )
148
+ go watchAndClose (rawSSH . Close )
149
149
150
150
go func () {
151
151
// Ensure stdout copy closes incase stdin is closed
@@ -170,7 +170,11 @@ func (r *RootCmd) ssh() *clibase.Cmd {
170
170
return err
171
171
}
172
172
defer sshSession .Close ()
173
- go watchAndClose (sshSession )
173
+ go watchAndClose (func () error {
174
+ _ = sshSession .Close ()
175
+ _ = sshClient .Close ()
176
+ return nil
177
+ })
174
178
175
179
if identityAgent == "" {
176
180
identityAgent = os .Getenv ("SSH_AUTH_SOCK" )
You can’t perform that action at this time.
0 commit comments