Skip to content

Terminal input becomes unresponsive, then dumps buffered text all at once #5

Description

@rishibaghel25

Describe the bug
While typing in a container/host/pod terminal, input sometimes stops showing up on screen. After a few seconds of apparent unresponsiveness, everything typed during that gap appears at once.

Steps to reproduce

  1. Open a terminal on any node (host, container, or pod)
  2. Type normally for a bit, including while other output is streaming or the canvas is doing a periodic refresh
  3. Observe that keystrokes occasionally stop appearing immediately, then arrive in a burst once the terminal "catches up"

Expected behavior
Every keystroke should render immediately, matching a normal local terminal.

What's already been tried

  • Fixed a WebSocket message-ordering bug in the relay (broadcastToBrowsers was spawning an unordered goroutine per message)
  • Fixed a race where input sent right after opening a terminal could be dropped before the exec session finished registering
  • Added output coalescing on the agent side (batches rapid PTY reads instead of one WS message per read syscall)
  • Switched the terminal to xterm.js's WebGL renderer instead of the default DOM renderer

None of the above fully resolved it. Worth investigating whether the canvas's periodic graph-diff re-render is contending for the main thread with terminal input handling, or whether there's a separate bottleneck not yet identified. Needs live profiling (Chrome DevTools performance tab while reproducing) to pin down further.

Environment
Reported via the OSS product (infracanvas serve, both direct localhost and Cloudflare-tunnel access).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions