MCPcopy Create free account
hub / github.com/coder/coder / Attach

Method Attach

agent/reconnectingpty/reconnectingpty.go:111–111  ·  view source on GitHub ↗

Attach pipes the connection and pty, spawning it if necessary, replays history, then blocks until EOF, an error, or the context's end. The connection is expected to send JSON-encoded messages and accept raw output from the ptty. If the context ends or the process dies the connection will be detach

(ctx context.Context, connID string, conn net.Conn, height, width uint16, logger slog.Logger)

Source from the content-addressed store, hash-verified

109 // from the ptty. If the context ends or the process dies the connection will
110 // be detached.
111 Attach(ctx context.Context, connID string, conn net.Conn, height, width uint16, logger slog.Logger) error
112 // Wait waits for the reconnecting pty to close. The underlying process might
113 // still be exiting.
114 Wait()

Callers 15

handleConnMethod · 0.95
NewFunction · 0.65
TestCliTemplateCreateFunction · 0.65
TestUserDeleteFunction · 0.65
TestTemplateDeleteFunction · 0.65
TestExpTaskListFunction · 0.65
TestTemplatePull_ToDirFunction · 0.65
TestRenameFunction · 0.65
TestExpTaskResumeFunction · 0.65
TestPortForwardFunction · 0.65

Implementers 2

screenReconnectingPTYagent/reconnectingpty/screen.go
bufferedReconnectingPTYagent/reconnectingpty/buffered.go

Calls

no outgoing calls

Tested by 15

TestCliTemplateCreateFunction · 0.52
TestUserDeleteFunction · 0.52
TestTemplateDeleteFunction · 0.52
TestExpTaskListFunction · 0.52
TestTemplatePull_ToDirFunction · 0.52
TestRenameFunction · 0.52
TestExpTaskResumeFunction · 0.52
TestPortForwardFunction · 0.52
TestUserListFunction · 0.52
TestUserShowFunction · 0.52