Fix command client cancellation during connection

This commit is contained in:
世界
2026-09-20 22:24:38 +08:00
parent 96b004bab1
commit cd568a563b
2 changed files with 132 additions and 98 deletions
+6 -1
View File
@@ -103,5 +103,10 @@ func NewStandaloneRemoteCommandClient(remoteOptions *RemoteConnectionOptions) (*
if err != nil {
return nil, err
}
return &CommandClient{remote: remote}, nil
ctx, cancel := context.WithCancel(context.Background())
return &CommandClient{
remote: remote,
ctx: ctx,
cancel: cancel,
}, nil
}