Skip to content

Feature request: allow pressing R to reconnect from a disconnected terminal #12

@htazq

Description

@htazq

Feature request

When an SSH session is disconnected or offline, it would be useful to support a keyboard-based reconnect shortcut, similar to MobaXterm: press R in the disconnected terminal panel to reconnect directly.

Current behavior

When the connection is lost, the terminal shows a message similar to:

[Connection failed permanently. Use right-click → Reconnect to retry.]

At this point, the user needs to use the mouse, right-click the terminal/session, and choose Reconnect manually.

Expected behavior

When the active terminal/session is in a disconnected state:

  • Pressing R or r reconnects the current session directly.
  • The shortcut should only be active when the session is disconnected/offline.
  • It should not affect normal connected terminal input.
  • It should work when the disconnected terminal tab/panel is focused.

Optional UX improvement:

Connection failed permanently. Press R to reconnect, or right-click → Reconnect.

Why this is useful

For SSH management tools, reconnect is a high-frequency operation, especially when servers reboot, network drops, or the SSH daemon restarts.

A one-key reconnect flow is faster than opening the context menu every time and matches the behavior many users are familiar with from MobaXterm.

Suggested implementation idea

Reuse the existing reconnect action behind the context menu. Add a keydown handler for the disconnected terminal state only:

if (isDisconnectedSession(activeSession) && event.key.toLowerCase() === 'r') {
  reconnectSession(activeSession.id);
}

The key handler should be scoped carefully so it does not intercept normal shell input while the SSH session is connected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions