Skip to content

Fix text prompt underlines in Windows consoles - #8489

Open
amcaplan wants to merge 2 commits into
mainfrom
fix-windows-underline
Open

Fix text prompt underlines in Windows consoles#8489
amcaplan wants to merge 2 commits into
mainfrom
fix-windows-underline

Conversation

@amcaplan

@amcaplan amcaplan commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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 Box single top border on Windows in both TextPrompt and DangerousConfirmationPrompt. 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:

  • All 26 tests in TextPrompt.test.tsx and DangerousConfirmationPrompt.test.tsx pass.
  • ESLint passes for the four changed TypeScript files.
  • CLI kit tsc --noEmit and git diff --check pass.

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

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing and includes a patch changeset

Assisted-By: devx/d54f9bfe-5e29-4147-aea5-071dbb6add71
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Sep 7, 2026
Assisted-By: devx/d54f9bfe-5e29-4147-aea5-071dbb6add71
@amcaplan

amcaplan commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🫰✨ 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-20260907163636

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@amcaplan

amcaplan commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Before:

Screenshot 2026-09-08 at 0 20 00

After:

Screenshot 2026-09-08 at 0 21 02

As mentioned above, only Windows is affected; Mac/Linux are unchanged.

@amcaplan
amcaplan marked this pull request as ready for review September 7, 2026 21:23
@amcaplan
amcaplan requested a review from a team as a code owner September 7, 2026 21:23
Copilot AI lite review requested due to automatic review settings September 7, 2026 21:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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 Box single top border on Windows for TextPrompt and DangerousConfirmationPrompt.
  • 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.

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

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants