Skip to content

fix: windows terminal rendering, telemetry notice, and plugin install issues#316

Merged
rhuanbarreto merged 11 commits into
mainfrom
fix/windows-terminal-and-plugin-install
May 15, 2026
Merged

fix: windows terminal rendering, telemetry notice, and plugin install issues#316
rhuanbarreto merged 11 commits into
mainfrom
fix/windows-terminal-and-plugin-install

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Telemetry notice repeating: noticeShown flag was not preserved when loading config from disk — now carried over correctly
  • Windows PowerShell garbled output: Inquirer permanently enables VTP mode (DISABLE_NEWLINE_AUTO_RETURN), causing \n to not return cursor to column 0. New withPromptFix() helper patches stdout.write, stderr.write, AND console methods (Bun's native console bypasses JS stream API). Patch is idempotent and permanent — only applied on Windows.
  • Copilot "already registered" failure: copilot plugin marketplace add now handles "already registered" gracefully instead of failing
  • Cursor VSIX compatibility: Pre-flight check reads Cursor's vscodeVersion from product.json and the VSIX engines.vscode from the ZIP. Skips install with clear message when incompatible instead of attempting and failing with a stack trace.
  • Noisy VS Code output removed: Dropped "Marketplace URL added to VS Code user settings" message
  • Better error messages: run() helper now captures stderr; install errors include actual detail
  • Detection consistency: editor-detect.ts now uses isCursorCliAvailable() instead of raw resolveCommand

Test plan

  • bun run validate passes (835 tests, 27/27 ADR checks, lint, typecheck, format, knip, build)
  • Manual test: archgate plugin install on Windows PowerShell — prompt renders correctly, output lines at column 0
  • Manual test: Copilot install succeeds when marketplace already registered
  • Manual test: Cursor shows clean incompatibility message instead of stack trace
  • Telemetry notice shows only once across invocations

… issues

- Fix telemetry notice showing on every invocation by preserving the
  `noticeShown` flag when loading config from disk

- Fix garbled console output on Windows PowerShell after inquirer prompts.
  Inquirer permanently enables VTP mode which sets DISABLE_NEWLINE_AUTO_RETURN,
  causing bare \n to not return cursor to column 0. The fix patches both
  stream writes (process.stdout/stderr.write) and console methods
  (console.log/error/warn) since Bun's native console bypasses the JS stream
  API. All inquirer prompts are now wrapped with withPromptFix().

- Fix Copilot CLI "marketplace already registered" error by detecting and
  skipping the duplicate gracefully instead of failing

- Add pre-flight VSIX compatibility check for Cursor: reads Cursor's
  vscodeVersion from product.json and the VSIX engines.vscode requirement,
  then skips install with a clear message when incompatible

- Remove noisy "Marketplace URL added to VS Code user settings" output

- Capture stderr in plugin install run() helper for better error messages

- Fix editor-detect.ts to use isCursorCliAvailable() for consistency

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 15, 2026

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1e8f897
Status: ✅  Deploy successful!
Preview URL: https://b1d97362.archgate-cli.pages.dev
Branch Preview URL: https://fix-windows-terminal-and-plu.archgate-cli.pages.dev

View logs

rhuanbarreto and others added 8 commits May 15, 2026 23:07
Cursor is pinned to VS Code 1.105.1 while the archgate VSIX targets a
newer engine. Rather than attempting the install and failing with a
stack trace, skip Cursor entirely and show a clear message. The VSIX
compatibility machinery (getCursorVscodeVersion, readVsixEngineVersion,
PowerShell ZIP extraction) is removed — it was over-engineered for what
is simply "not supported yet."

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Cursor's VS Code engine is too old for the archgate VSIX, so don't
detect or pre-check it in the editor selection prompt. Users won't see
"Cursor (detected)" followed by a failed install.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Cursor supports plugins via Team Private Marketplaces, not VSIX
installation (the VSIX targets a newer VS Code engine than Cursor
provides). Show the marketplace URL and instructions to add it in
Cursor Settings instead of attempting a VSIX install that would fail.

Ref: https://cursor.com/docs/plugins#team-marketplaces
Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Update EN and pt-br docs to reflect that Cursor uses Team Private
Plugin Marketplaces instead of VSIX installation, and that VS Code
no longer shows the "marketplace URL added" message.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Instead of permanently monkey-patching console.log/error/warn (which
diverges from Bun's native formatting), use SetConsoleMode via Bun FFI
to clear the DISABLE_NEWLINE_AUTO_RETURN flag that inquirer sets.
This fixes the root cause at the OS level.

The stream-level patch (process.stdout/stderr.write) is still needed
during prompt rendering since inquirer writes through the JS stream API
while the flag is active. The console-method redirect is now only a
fallback for environments where FFI is unavailable (e.g., mintty pipes).

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
FFI calls to kernel32.dll SetConsoleMode would be flagged by antimalware
/ EDR software — a scripting runtime dynamically loading system DLLs
looks indistinguishable from malicious activity.

The root cause is a runtime bug (Node.js/Bun should restore the console
mode in rl.close()), tracked at:
  SBoudrias/Inquirer.js#2123

Keep the pure JS workaround: stream-level \n → \r\n patches +
console method redirects through the patched streams.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
withPromptFix is now a pure passthrough on non-Windows (early return,
no cursor reset, no patches). Tests use test.skipIf for platform-
conditional assertions.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@rhuanbarreto rhuanbarreto changed the title fix: Windows terminal rendering, telemetry notice, and plugin install issues fix: windows terminal rendering, telemetry notice, and plugin install issues May 15, 2026
The cursor reset (cursorTo column 0) after prompts is needed on all
platforms — existing editor-detect tests depend on it. Only the
stream/console newline patches are Windows-specific.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
The cursor reset and all patches are Windows-only workarounds. On
non-Windows, withPromptFix just calls fn() directly. Updated
editor-detect cursor reset tests to skip on non-Windows with
describe.skipIf since the behavior only applies on Windows.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@rhuanbarreto rhuanbarreto merged commit fe41ab6 into main May 15, 2026
11 checks passed
@rhuanbarreto rhuanbarreto deleted the fix/windows-terminal-and-plugin-install branch May 15, 2026 22:57
@archgatebot archgatebot Bot mentioned this pull request May 15, 2026
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