Skip to content

Bug: Session reconnection loses scroll position and context #12

@vultuk

Description

@vultuk

Description

When reconnecting to an existing session after a disconnect (network issue or browser refresh), the terminal loses its scroll position and sometimes displays garbled output.

Steps to Reproduce

  1. Start a session and run commands that produce long output
  2. Scroll up to view previous output
  3. Refresh the browser or disconnect/reconnect
  4. Observe that scroll position is reset to bottom
  5. Sometimes output appears duplicated or corrupted

Expected Behavior

  • Scroll position should be maintained or restored
  • Output buffer should be cleanly restored without corruption
  • User should return to the same view they had before disconnecting

Current Behavior

  • Terminal always scrolls to bottom on reconnect
  • Output sometimes shows ANSI escape sequences or duplicated lines
  • User loses their place in the output

Possible Solutions

  • Store scroll position in session state
  • Implement proper output buffer serialization
  • Add option to restore scroll position on reconnect
  • Clear and rebuild terminal display on reconnect
  • Implement proper ANSI sequence handling in buffer restoration

Environment

  • Affects all browsers
  • Most noticeable with sessions containing lots of colored output

Priority

Medium - Impacts user experience when working with long-running sessions

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions