Skip to content

fix: enable Windows PTY compatibility for local terminals#286

Merged
binaricat merged 6 commits intomainfrom
codex/fix-issue-280-windows-local-pty
Mar 7, 2026
Merged

fix: enable Windows PTY compatibility for local terminals#286
binaricat merged 6 commits intomainfrom
codex/fix-issue-280-windows-local-pty

Conversation

@binaricat
Copy link
Owner

Summary

  • expose the Windows local PTY backend/build info from preload
  • pass xterm.js windowsPty compatibility metadata for Windows local terminal sessions
  • align Netcatty's local PowerShell rendering path with node-pty's ConPTY/WinPTY behavior so cursor-based redraw animations do not accumulate stale frames

Why

Issue #280 shows Codex CLI's animated status text being repeatedly painted down the screen when run inside Netcatty's local PowerShell terminal on Windows. Netcatty starts local shells via node-pty, but the frontend terminal was not told it was rendering a Windows PTY stream, so xterm.js could not enable its Windows-specific redraw/wrap heuristics.

Validation

  • npm run lint
  • npm run build

Notes

  • This was validated statically in the current environment, but the reporter's exact Windows PowerShell + Codex CLI animation still needs runtime verification on Windows.

Refs #280

@binaricat
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab87cf611d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const rendererType = settings?.rendererType ?? "auto";
const bridge = netcattyBridge.get();
const windowsPty =
platform === "win32" && ctx.host.protocol === "local"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include localhost local sessions in windowsPty detection

The new windowsPty option is only enabled when ctx.host.protocol === "local", but local sessions are also started for hosts with hostname === "localhost" (components/Terminal.tsx, local-session branch). On Windows, those legacy/default localhost entries will still run through the local node-pty path without windowsPty metadata, so the redraw/wrap heuristics this commit intends to enable remain disabled and the rendering issue can persist for that class of local sessions.

Useful? React with 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Local sessions are started for both protocol === "local" and legacy/default hostname === "localhost" entries, so I aligned the windowsPty detection with that same predicate in 4c32ea2.

@binaricat binaricat marked this pull request as ready for review March 7, 2026 16:20
@binaricat binaricat merged commit 0ff6273 into main Mar 7, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 991beb6ff4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const settings = ctx.terminalSettingsRef.current;
const rendererType = settings?.rendererType ?? "auto";
const bridge = netcattyBridge.get();
const isLocalTerminalHost = ctx.host.protocol === "local";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match local-host predicate when setting windowsPty

windowsPty is only enabled when ctx.host.protocol === "local", but local sessions are still launched for legacy/default hosts where hostname === "localhost" (see components/Terminal.tsx, local-session branch at line 515), so those Windows local terminals miss the xterm Windows PTY heuristics this fix is trying to enable. Fresh evidence: this commit’s gate at createXTermRuntime keeps the narrower predicate while the launcher path still accepts both local forms, so localhost-backed local sessions remain affected.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant