MCPcopy
hub / github.com/wavetermdev/waveterm / runSessionWithContext

Function runSessionWithContext

pkg/remote/conncontroller/conncontroller.go:352–366  ·  view source on GitHub ↗
(ctx context.Context, session *ssh.Session, cmd string)

Source from the content-addressed store, hash-verified

350}
351
352func runSessionWithContext(ctx context.Context, session *ssh.Session, cmd string) error {
353 errCh := make(chan error, 1)
354
355 go func() {
356 errCh <- session.Run(cmd)
357 }()
358
359 select {
360 case <-ctx.Done():
361 session.Close()
362 return ctx.Err()
363 case err := <-errCh:
364 return err
365 }
366}
367
368func (conn *SSHConn) getEnvironmentNoPty(ctx context.Context, client *ssh.Client) (map[string]string, error) {
369 session, err := client.NewSession()

Callers 2

getEnvironmentNoPtyMethod · 0.85
getEnvironmentWithPtyMethod · 0.85

Calls 3

RunMethod · 0.80
ErrMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected