Skip to content

fix(tui): shell connect broken — wrong ssh-proxy CLI arguments after #175 rename #188

Description

@johntmyers

Summary

The TUI shell connect ([s] key on sandbox detail) is completely broken. Pressing it flashes the screen briefly and returns to the TUI immediately. After a few attempts the terminal goes black.

Root Cause

Commit 61f3e7f (#175) renamed the ssh-proxy subcommand's CLI arguments as part of the cluster→gateway rebranding:

Before #175 After #175 Purpose
--gateway --gateway-endpoint Gateway URL (token mode)
--cluster --gateway Cluster/gateway name (TLS cert resolution)

That commit updated three of the five proxy command format strings:

  • CLI ssh_session_config in ssh.rs — updated
  • CLI print_ssh_config in ssh.rs — updated
  • TUI start_port_forwards in lib.rs — updated
  • TUI handle_shell_connect in lib.rsmissed
  • TUI handle_exec_command in lib.rsmissed

The two missed functions still build the proxy command as:

nemoclaw ssh-proxy --gateway <url> --sandbox-id <id> --token <token>

After the rename, --gateway means "cluster name" (name mode), not "URL" (token mode). Since --gateway-endpoint is missing, the ssh-proxy subcommand can't match token mode. Since --name is also missing, it can't match name mode either. It falls through to the error case and exits immediately.

SSH sees its ProxyCommand fail and exits — that's the flash. Repeated rapid TUI suspend/resume cycles (leave alternate screen → SSH fails instantly → re-enter alternate screen) corrupt the terminal state — that's the black screen.

Pre-existing gap

These two functions also never passed the cluster name for TLS cert resolution. The TUI was added in 734ec5e (Mar 2, 09:56), four hours before 189470c added --cluster to the CLI's proxy command (Mar 2, 13:52). The TUI was never backfilled. Before #175 this was a latent issue (no TLS on local clusters). After #175 it became a hard failure.

Fix

Change both handle_shell_connect and handle_exec_command to use the correct argument names matching the current main.rs definitions, and pass the cluster name:

// Before (broken)
"{exe_str} ssh-proxy --gateway {gateway_url} --sandbox-id {} --token {}"

// After (correct — matches start_port_forwards and CLI ssh_session_config)
"{exe_str} ssh-proxy --gateway-endpoint {gateway_url} --sandbox-id {} --token {} --gateway {cluster}"

Affected Code

  • crates/navigator-tui/src/lib.rshandle_shell_connect() (~line 712)
  • crates/navigator-tui/src/lib.rshandle_exec_command() (~line 854)

Reproduction

  1. mise run term
  2. Select a sandbox, press Enter
  3. Press [s] to connect shell
  4. Screen flashes and returns to TUI immediately
  5. Repeat a few times — terminal goes black

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions