fix: preserve terminal colors with stdout redaction in varlock run#575
Open
fix: preserve terminal colors with stdout redaction in varlock run#575
varlock run#575Conversation
🦋 Changeset detectedLatest commit: c77d6c9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
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 |
Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/90e074e2-1dc1-493f-bac7-1bebdfd12b00 Co-authored-by: philmillman <3722211+philmillman@users.noreply.github.com>
Deploying with
|
| 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 Apr 9, 2026
varlock run
theoephraim
approved these changes
Apr 9, 2026
philmillman
approved these changes
Apr 9, 2026
commit: |
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.
When
varlock runpipes stdout/stderr for redaction, child processes seeisTTY === falseand 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, injectFORCE_COLORinto the child process environment so color libraries (chalk, kleur, etc.) output colors even through a pipefullInjectedEnv(COLORTERM,TERM,TERM_PROGRAM) → setsFORCE_COLORto1,2, or3accordinglyNO_COLORorFORCE_COLORare already set (respects user overrides); uses=== undefinedto 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 colorscli-commands.mdxandsmoke-tests.mdto reflect the new default behaviorTools that only check
process.stdout.isTTYdirectly (without honoringFORCE_COLOR) still require--no-redact-stdout.