Fix text prompt underlines in Windows consoles - #8489
Conversation
Assisted-By: devx/d54f9bfe-5e29-4147-aea5-071dbb6add71
Assisted-By: devx/d54f9bfe-5e29-4147-aea5-071dbb6add71
|
/snapit |
|
🫰✨ Thanks @amcaplan! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260907163636Caution After installing, validate the version by running |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small, platform-scoped, align with existing layout patterns, and include targeted cross-platform rendering assertions plus a patch changeset.
Pull request overview
This PR updates CLI Kit’s Ink-based text prompt components to render underlines correctly in legacy Windows console fonts. It switches from using the ▔ character (often unsupported in cmd/PowerShell fonts) to an Ink Box top border on Windows, while preserving the existing underline rendering on macOS/Linux, and adds cross-platform rendering tests plus a patch changeset.
Changes:
- Render prompt underlines using an Ink
Boxsingle top border on Windows forTextPromptandDangerousConfirmationPrompt. - Preserve existing
▔underline rendering on non-Windows platforms. - Add tests covering Windows/macOS/Linux underline rendering and color change on validation error; include a patch changeset.
File summaries
| File | Description |
|---|---|
| packages/cli-kit/src/private/node/ui/components/TextPrompt.tsx | Switch underline rendering to an Ink top border on Windows; keep ▔ underline elsewhere. |
| packages/cli-kit/src/private/node/ui/components/TextPrompt.test.tsx | Mock platform detection and add parameterized tests validating underline rendering across OSes. |
| packages/cli-kit/src/private/node/ui/components/DangerousConfirmationPrompt.tsx | Apply the same Windows underline approach to the dangerous confirmation prompt. |
| packages/cli-kit/src/private/node/ui/components/DangerousConfirmationPrompt.test.tsx | Add platform-aware underline rendering tests for the dangerous confirmation prompt. |
| .changeset/windows-prompt-underline.md | Patch changeset documenting the Windows underline rendering fix. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


WHY are these changes introduced?
Text prompts draw their underline with the upper one eighth block character (
▔), which is unsupported by legacy Windows console fonts used with cmd and PowerShell.WHAT is this pull request doing?
Use an Ink
Boxsingle top border on Windows in bothTextPromptandDangerousConfirmationPrompt. Ink draws the standard horizontal line (─) and handles its width, preserving indentation and idle/error colors. Keep the original▔underline on macOS and Linux.Add rendering coverage for Windows, macOS, and Linux in normal and validation-error states, and include a patch changeset.
How to test your changes?
Validated locally:
TextPrompt.test.tsxandDangerousConfirmationPrompt.test.tsxpass.tsc --noEmitandgit diff --checkpass.For manual verification, open a CLI text prompt in cmd or PowerShell, enter text, and trigger a validation error. Confirm the underline renders as a continuous line and changes from cyan to red. Native Windows console testing has not been performed on this macOS machine.
Checklist