Skip to content

[feature] dynamic cursor color change based on connection status #1353

@prasanth-30011

Description

@prasanth-30011

Summary

When using Mosh over unstable networks, users currently have no visual cue for the connection state. This PR proposes making the terminal cursor color automatically change depending on the connection status (e.g. green = healthy, yellow = reconnecting, red = disconnected).

Motivation

  • Immediate visual feedback helps users quickly recognize connectivity issues
  • Keeps the UI minimal, with no extra text clutter
  • Useful especially for mobile / flaky links

Design

  1. Hook into Mosh's internal state machine or status update loop
  2. Emit ANSI escape sequences to set cursor color accordingly
  3. Make color thresholds and states configurable (via .moshrc or env var)
  4. Fallback to default behavior if terminal doesn’t support cursor-color escape

Backwards Compatibility

If the client terminal does not support cursor color escapes, behavior gracefully degrades to default.

Testing

  • Simulate connection drop / reconnect
  • Check color changes on various supported terminals
  • Ensure that no visual glitches or flicker occur

Impact

Low performance or network overhead, as this only updates style on state transitions.

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