Skip to content

tui: lag/hang on Windows Terminal when the session sidebar is visible (2.1.x, OpenTUI 0.6.6) #57676

Open

Description

@James0507-cell

Summary

On native Windows (Windows Terminal), the v2.1.x TUI becomes laggy and appears to hang at large window sizes, and the trigger is the session sidebar. At the same window size and in the same session, session.sidebar: "auto" (the default, which mounts the sidebar above 120 columns) is laggy, while session.sidebar: "hide" is smooth. The boundary appears to be v2.1.0, the first release that shipped @opentui/* 0.6.6 instead of 0.5.17.

Environment

  • opencode version: 2.1.2 (latest, opencode --version)
  • OS: Windows 11, Microsoft Windows NT 10.0.26200.0
  • Terminal: Windows Terminal 1.24.12741.0 (WT_SESSION set), TERM=xterm-256color, no TERM_PROGRAM
  • Shell: PowerShell 7.6.6
  • Install/channel: npm global @opencode/cli, latest channel, shared background service
  • Active plugins: opencode-cmd-provider, file:///C:/Users/Admin/opencode-navigator (server); C:/Users/Admin/opencode-subagent-monitor (TUI). None of them claim a sidebar.content or sidebar.footer slot.
  • Display: 1536x864

Reproduction

  1. Use Windows Terminal on native Windows, with the window maximized (well above 120 columns).
  2. Keep the default session.sidebar: "auto" and horizontal tabs (tabs.layout: "horizontal").
  3. Open a session with a moderate transcript and interact with it, or let the agent stream output.
  4. The UI lags and appears to hang; input and streamed output stutter visibly.
  5. Set session.sidebar: "hide" (hot reloads) or shrink the window to 120 columns or fewer. The lag disappears immediately at the same width/height in the same session, with no other change.

Expected Behavior

Smooth rendering at any window size with the sidebar visible.

Actual Behavior

Lag tracks the sidebar being mounted, not scroll or resize alone: the UI is unresponsive while the agent streams, and closing the sidebar fixes it without changing session or window height.

Additional Context

Sidebar threshold

packages/tui/src/component/session-frame.tsx:

const wide = createMemo(() => dimensions().width - props.verticalTabsWidth > 120)
const sidebarVisible = createMemo(() => {
  if (data.session.get(props.sessionID)?.parentID) return false
  if (sidebarOpen()) return true
  return (config.data.session?.sidebar ?? "auto") === "auto" && wide()
})

With horizontal tabs, verticalTabsWidth is 0, so the sidebar mounts at 121 columns or more. Shrinking below that produces the "only lags when large" behavior.

Renderer boundary

@opentui/core, @opentui/solid, and @opentui/keymap are pinned in the root workspace catalog:

Release @opentui/core
2.0.28 - 2.0.32 0.5.17
2.1.0 - 2.1.2 0.6.6

2.1.0 was the first release on 0.6. OpenTUI 0.6.2 was merged in #55083 on 2026-10-13 and reverted in #55300 on 2026-10-14 before any release shipped it; #55339 re-landed 0.6.5 on 2026-10-19.

Bisect status

Reported from memory: the previous 4-5 releases (roughly 2.0.29 - 2.0.32, all on 0.5.17) were smooth. Not yet re-verified by pinning 2.0.32 in a clean environment; happy to run that if it helps.

Tried

  • Disabling the built-in opencode.sidebar.todo slot with "-opencode.sidebar.todo": no change. With only Context, MCP, and footer left in the sidebar, the lag persisted, so the per-token sessionTodos() scan is not the cause.
  • Hiding the sidebar: fixes it completely, which is the current workaround.
  • Keeping the window at 120 columns or fewer: also fixes it (the sidebar is not mounted).

Not tested

Related

Activity

  1. opencode-agent commented on Oct 21, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and for narrowing it down to the sidebar. I couldn't reproduce this here because the problem seems specific to native Windows and Windows Terminal, and this sandbox only has Linux with a virtual terminal. A maintainer with a Windows machine will need to check it.

    A few things would help them narrow it down, if you have time:

    Related issues, most likely first:

    Until then, session.sidebar: "hide" is a good workaround.

  2. James0507-cell commented on Oct 21, 2026

    @James0507-cell
    Author

    Thanks — I ran all three checks on the same Windows 11 machine, same session, with the window at 160x45 (above the 120-column sidebar threshold). Per-run TUI settings were injected with OPENCODE_CLI_CONFIG_CONTENT, so my cli.json was not modified.

    Build TUI settings Result
    2.1.2 sidebar: "auto" lags
    2.1.2 sidebar: "hide" smooth
    2.1.2 sidebar: "auto", animations: false lags
    2.1.2 sidebar: "auto", plugins: [] lags
    2.0.32 sidebar: "auto" smooth

    So:

    2.0.32 was installed to a throwaway prefix and run with --standalone against a copy of the DB (OPENCODE_DB), so it did not touch the 2.1.x session data. Same session ID as the 2.1.2 runs.

    One extra thing I noticed while setting this up: at 200x50 (wider than the 1536px display, which puts Windows Terminal in horizontal-scroll state) 2.1.2 also lagged while the sidebar area was blank. I did not isolate that case, so it may be a separate size-related problem rather than the same bug. At 160x45 the sidebar rendered normally and the auto/hide difference was unambiguous.

    Idle CPU was not a useful signal here: 12-second samples gave 8.2-11.3% of one core across auto/hide/no-plugins with no consistent ordering. The symptom is input and render latency, not sustained idle CPU.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions