Skip to main content

Module connection

Module connection 

Source

Structs§

ConnectResult
Result of an SSH connection attempt.

Functions§

connect
Launch an SSH connection to the given host alias. Uses the system ssh binary with inherited stdin/stdout. Stderr is piped and forwarded to real stderr in real time so the output is captured for error detection. Passes -F <config_path> so the alias resolves against the correct config file. When askpass is Some, delegates to askpass_env::configure_ssh_command to wire up SSH_ASKPASS, SSH_ASKPASS_REQUIRE=force and the PURPLE_* env vars.
connect_tmux_window
Open an SSH connection in a new tmux window. Returns immediately after the window is created. The SSH session runs asynchronously in the new window. Returns an error if tmux is not available or the window cannot be created.
connect_tmux_window_with_remote_command
tmux variant of connect_with_remote_command. Opens a new tmux window running ssh -t <alias> <remote_command> so the TUI stays alive in the original window. Same askpass-incompatible caveat as connect_tmux_window.
connect_with_remote_command
Launch an SSH connection that runs a single remote command in interactive mode. Mirrors connect() exactly except for two additions: -t to allocate a TTY (required for the remote shell docker exec opens) and the trailing remote_command string passed to ssh as one argv slot. The remote shell receives the string as a single command line, so multi-token commands and shell operators like || work naturally.
is_in_tmux
Returns true if the current process is running inside a tmux session.
parse_host_key_error
Parse host key verification error from SSH stderr output. Returns (hostname, known_hosts_path) if the error is a changed host key.
stderr_summary
Extract a concise reason from SSH stderr for display in the toast. Joins all non-empty, non-banner lines with | so the full context is visible. Truncates to 200 chars (char-safe) if needed.