fix: windows terminal rendering, telemetry notice, and plugin install issues#316
Merged
Merged
Conversation
… 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>
Deploying archgate-cli with
|
| 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 |
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
noticeShownflag was not preserved when loading config from disk — now carried over correctlyDISABLE_NEWLINE_AUTO_RETURN), causing\nto not return cursor to column 0. NewwithPromptFix()helper patchesstdout.write,stderr.write, AND console methods (Bun's native console bypasses JS stream API). Patch is idempotent and permanent — only applied on Windows.copilot plugin marketplace addnow handles "already registered" gracefully instead of failingvscodeVersionfromproduct.jsonand the VSIXengines.vscodefrom the ZIP. Skips install with clear message when incompatible instead of attempting and failing with a stack trace.run()helper now captures stderr; install errors include actual detaileditor-detect.tsnow usesisCursorCliAvailable()instead of rawresolveCommandTest plan
bun run validatepasses (835 tests, 27/27 ADR checks, lint, typecheck, format, knip, build)archgate plugin installon Windows PowerShell — prompt renders correctly, output lines at column 0