Skip to content

v0.4.0 — inline fzf-style mode + manage rebind

Choose a tag to compare

@hang-in hang-in released this 20 May 02:25
· 97 commits to master since this release

sshs v0.4.0 introduces an inline (fzf-style) host browser as the
default command. Type to filter, Enter to ssh, and you're back to
your shell — no alternate-screen takeover, no UI re-entry after ssh.

The full v0.3 management TUI is one flag away: sshc -m (or --manage).

Added

  • Inline mode (default sshc). Opens a ~15-line viewport BELOW
    the shell prompt via ratatui's Viewport::Inline. Type to filter
    immediately (fzf muscle memory), ↑/↓ or j/k to navigate,
    Enter to ssh, Esc/Ctrl+C to cancel, r to reconnect to the
    last alias. Viewport area is cleared on exit so the shell sees no
    residue. Terminal below 12 rows falls back to manage mode with a
    one-line stderr notice.
  • Manage mode (-m / --manage). The v0.3 alternate-screen
    TUI, retained behind a flag. Default behaviour changed in v0.4 —
    intentional breaking change for a single-user tool.
  • Manage-mode key rebind (BRIEF §5):
    • Enter opens the modify form for sshs.conf-managed hosts;
      falls through to $EDITOR for external-source hosts.
    • s — ssh connect (was Enter in v0.3).
    • m — unbound (merged into Enter).
  • ScreenMode { Alternate, Inline(u16) } on TerminalGuard.
    RAW_ACTIVE and ALT_ACTIVE tracked separately so the panic hook
    doesn't emit LeaveAlternateScreen in inline mode (would
    corrupt a normal-mode terminal).
  • InlineApp — lean read-only host browser (no probes, no
    modals, no forms, no storage writes).
  • tui::inline_runtime — single-shot event loop +
    handle_connect_inline that tears down the viewport before ssh
    spawn and exits the process with an SshResult-derived ExitCode.
  • src/run.rsinline() / manage() dispatch helpers.
    Keeps main.rs thin (41 LOC, R-G4).
  • R-G9 boundary gate enforces inline_app's read-only scope.
  • examples/inline_prototype.rs — standalone ratatui Viewport
    smoke test, useful for terminal-compat triage.

Changed

  • main() returns ExitCode (Termination). ssh exit codes
    propagate to the parent shell from inline mode (Quit → SUCCESS;
    Connect/Reconnect → low byte of the ssh code;
    Crashed/UnknownTermination → FAILURE).
  • TerminalGuard's acquire takes a ScreenMode. Existing v0.3
    callers pass ScreenMode::Alternate for unchanged behaviour.

Tests

162 (v0.3.0) → 190 (v0.4.0). New: 13 InlineApp unit tests + 5
inline integration tests + ScreenMode equality + 3 manage-rebind
tests (s connects, Enter on external, Enter on managed, m
unbound). All R-G1..R-G9 grep gates clean.

Compatibility

  • v0.3 users running sshc land in inline mode on first launch.
    Selection + Enter ssh-connect work as expected.
  • For the v0.3 behaviour, use sshc -m.
  • ~/.ssh/config, ~/.ssh/config.d/sshs.conf, state.toml
    unchanged. First-run setup flow (Include injection) runs in
    manage mode only.

See CHANGELOG.md for the full diff vs v0.3.0.