Skip to content

fix: preserve terminal colors with stdout redaction in varlock run#575

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-terminal-colors-issue
Open

fix: preserve terminal colors with stdout redaction in varlock run#575
Copilot wants to merge 2 commits intomainfrom
copilot/fix-terminal-colors-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

When varlock run pipes stdout/stderr for redaction, child processes see isTTY === false and disable colors — even on a real terminal. Previously the only workaround was --no-redact-stdout, which sacrifices redaction entirely.

Changes

  • run.command.ts: When piping for redaction and the parent stdout is a TTY, inject FORCE_COLOR into the child process environment so color libraries (chalk, kleur, etc.) output colors even through a pipe
    • Detects color depth from fullInjectedEnv (COLORTERM, TERM, TERM_PROGRAM) → sets FORCE_COLOR to 1, 2, or 3 accordingly
    • Skipped when NO_COLOR or FORCE_COLOR are already set (respects user overrides); uses === undefined to handle empty-string values correctly
  • --no-redact-stdout: Description updated — it's now specifically for tools needing raw TTY pass-through (e.g., psql, claude), not just for colors
  • Docs: Updated cli-commands.mdx and smoke-tests.md to reflect the new default behavior

Tools that only check process.stdout.isTTY directly (without honoring FORCE_COLOR) still require --no-redact-stdout.

Copilot AI linked an issue Apr 9, 2026 that may be closed by this pull request
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: c77d6c9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
varlock Patch
@varlock/astro-integration Patch
@varlock/cloudflare-integration Patch
@varlock/expo-integration Patch
@varlock/nextjs-integration Patch
@varlock/vite-integration Patch
@varlock/1password-plugin Patch
@varlock/aws-secrets-plugin Patch
@varlock/azure-key-vault-plugin Patch
@varlock/bitwarden-plugin Patch
@varlock/dashlane-plugin Patch
@varlock/google-secret-manager-plugin Patch
@varlock/hashicorp-vault-plugin Patch
@varlock/infisical-plugin Patch
@varlock/keepass-plugin Patch
@varlock/pass-plugin Patch
@varlock/passbolt-plugin Patch
@varlock/proton-pass-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 9, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
varlock-website c77d6c9 Commit Preview URL

Branch Preview URL
Apr 09 2026, 03:35 PM

Copilot AI changed the title [WIP] Fix terminal colors not working in varlock run fix: preserve terminal colors with stdout redaction in varlock run Apr 9, 2026
Copilot AI requested a review from philmillman April 9, 2026 15:32
@philmillman philmillman marked this pull request as ready for review April 9, 2026 16:53
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 9, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@varlock/ci-env-info@575
npm i https://pkg.pr.new/varlock@575

commit: c77d6c9

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Terminal Colors Don't work

3 participants