Skip to content

Regression: typing freezes for ~2 seconds intermittently (Windows) — bisected to 3bf380d #237

@tarikguney

Description

@tarikguney

Summary

During normal typing in a psmux session, input periodically stalls — the cursor stops advancing, typed characters do not appear, and after ~2 seconds typing resumes and accumulated keystrokes show up. The stall happens silently with no error and self-recovers. More visible under fast or sustained typing.

Bisect

Narrowed to a single commit via binary search between a known-good 3-week-old state and current master:

  • 86a7519 (2026-04-10 10:20) — works
  • cb0d429 (2026-04-11 16:39) — works
  • 8875bb5 (2026-04-11 19:22) — works
  • c28a428 (2026-04-11 23:02) — works
  • 3bf380d (2026-04-12 03:18) — reproduces the freeze
  • master a138a9e — reproduces

Single-commit delta: 3bf380d "fix(paste): eliminate local paste duplication on Windows (#197)".

Root cause

3bf380d added a paste_suppress_until timestamp in src/client.rs and wired five new call sites (POST_CONFIRMED, CLIPBOARD_FALLBACK, TOP_CONFIRMED, STAGE2_TIMEOUT, Event::Paste handler) that set it to now + 2 seconds whenever a paste-shaped event is detected.

Pre-existing code (lines 2079–2107, the KeyCode::Char(c) handler) already contained a suppression check that drops typed characters while paste_suppress_until is in the future. Before 3bf380d that branch was effectively dormant because paste_suppress_until was rarely set. After 3bf380d any of the five new call sites can fire on normal typing — in particular STAGE2_TIMEOUT, which triggers when typed characters accumulate in paste_pend without a matching Ctrl+V within 300ms (i.e. the exact pattern of a user typing normally).

Once set, the suppression window silently drops every typed character for 2 seconds. That is exactly the observed symptom:

Type at fluent pace → characters accumulate in paste_pend → stage2 heuristic misclassifies them as a paste → paste_suppress_until = now + 2s → next 2 seconds of typing silently dropped → window expires → typing resumes, accumulated keystrokes surface.

Why it doesn't reproduce everywhere

  • Requires typing fast enough for paste_pend to fill before a 300ms quiet period — slow single-finger typing may not trip it.
  • Pastes themselves still work, because the paste content is sent before paste_suppress_until is set.

Environment

  • psmux master (HEAD a138a9e)
  • Windows 11, pwsh 7.x, PSReadLine 2.4.5, Windows Terminal 1.23.x
  • Reproduces locally and over RDP.

Related

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