[upstream handoff] fix: fall back to flat output when stderr is not a terminal - #10
Draft
rigelbuild-bot wants to merge 1 commit into
Draft
rigelbuild-bot wants to merge 1 commit into
rigelbuild-bot wants to merge 1 commit into
Conversation
… terminal This branch is based on upstream v0.5.4 (0c03418), not on this fork's main. Matt pulls it and pushes it to the upstream Codeberg repo (codeberg.org/abrenneke/jj-vine). The two sections below are the text to open the upstream PR with; they are the deliverable, not this fork PR's own description. ## Upstream PR title fix: fall back to flat output when stderr is not a terminal ## Upstream PR description `run_stdout` selects the `indicatif` spinner whenever the command supports it and `--verbose` is off, without checking whether stderr is a terminal. `indicatif` draws nothing when stderr is not a TTY, so running with stderr piped or captured (CI, an editor's terminal, `2>file`) shows no progress at all and the command looks like it has hung. This gates the choice on `std::io::stderr().is_terminal()` through a small pure helper. When stderr is not a terminal the output falls back to the flat logger, which writes each step through `tracing` and stays visible. `--verbose` still forces flat output. Adds unit tests over the verbose / command-supports-interactive / is-a-terminal combinations. Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
upstream-vcs/upstream-tty-progress
branch
from
September 11, 2026 23:25
60227b6 to
63b75ce
Compare
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.
This branch is based on upstream v0.5.4 (0c03418), not on this fork's main. Matt pulls it and pushes it to the upstream Codeberg repo (codeberg.org/abrenneke/jj-vine). The two sections below are the text to open the upstream PR with; they are the deliverable, not this fork PR's own description.
Upstream PR title
fix: fall back to flat output when stderr is not a terminal
Upstream PR description
run_stdoutselects theindicatifspinner whenever the command supports it and--verboseis off, without checking whether the spinner will actually draw.indicatifrenders nothing when stderr is not a usable terminal, so running with stderr piped or captured (CI, an editor's terminal,2>file) shows no progress at all and the command looks like it has hung.This builds an interactive spinner only when the run is eligible for one (
--verboseoff and the command shows progress), then keeps it only ifindicatifwill actually draw it, checked through the spinner's ownis_hidden(). Whenindicatifwould hide it the output falls back to the flat logger, which writes each step throughtracingand stays visible. Askingindicatifdirectly is stronger than testingstderr().is_terminal()in the caller:indicatifalso hides on a terminal it cannot drive, so the gate can never disagree with the renderer about whether the spinner appears.Adds unit tests over the two conditions the caller controls (verbose, and whether the command shows progress); the terminal check is
indicatif's and is exercised through it.Co-authored-by: Matt Wilkinson matt@rigel.build