Documentation
¶
Index ¶
Constants ¶
const DefaultEscapeChar byte = 0x1D // Ctrl+]
Variables ¶
This section is empty.
Functions ¶
func FormatEscapeChar ¶
FormatEscapeChar returns a human-readable representation of the escape byte.
func HandleResize ¶
func HandleResize(localFd, remoteFd uintptr) func()
HandleResize propagates the initial terminal size from localFd to remoteFd and listens for SIGWINCH to relay subsequent resize events. Returns a cleanup function that stops the signal handler.
func ParseEscapeChar ¶
ParseEscapeChar parses the --escape-char flag value. It accepts:
- Caret notation for control characters: "^]", "^A", "^C", etc.
- A single printable or control character (raw byte).
func Relay ¶
func Relay(rw io.ReadWriter, escapeKeys []byte) error
Relay runs bidirectional I/O between the user terminal and the remote. rw can be a PTY (*os.File) or a Unix socket (net.Conn) — any io.ReadWriter. escapeKeys is the byte sequence that triggers a detach (e.g. {0x1D, '.'}). Returns nil on clean disconnect (escape sequence, EOF, or EIO).
The caller is responsible for closing the underlying connection after Relay returns, which unblocks the remaining goroutine.
Types ¶
This section is empty.