Set TERM=dumb under PTY to prevent capability-probe hangs#1363
Merged
j178 merged 3 commits intoj178:masterfrom Jan 15, 2026
Merged
Set TERM=dumb under PTY to prevent capability-probe hangs#1363j178 merged 3 commits intoj178:masterfrom
TERM=dumb under PTY to prevent capability-probe hangs#1363j178 merged 3 commits intoj178:masterfrom
Conversation
…o timeout issue Signed-off-by: yihong0618 <zouzou0208@gmail.com>
📦 Cargo Bloat ComparisonBinary size change: +0.00% (22.3 MiB → 22.3 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1363 +/- ##
=======================================
Coverage 90.11% 90.11%
=======================================
Files 80 80
Lines 15927 15928 +1
=======================================
+ Hits 14353 14354 +1
Misses 1574 1574 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
TERM=dumb under PTY to prevent capability-probe hangs
Owner
|
Thanks @yihong0618 for debugging and the quick fix! Do you think setting |
Contributor
Author
yep cpython also use something like this name |
Contributor
Author
This was referenced Feb 5, 2026
j178
added a commit
that referenced
this pull request
Feb 6, 2026
Closes #1561 Previous fix: #1363 We run subcommands under a PTY so they behave like they do in an interactive terminal (colors, progress bars, etc.). However, this is still a *pseudo*-terminal and it doesn't necessarily provide a full/accurate terminal environment. Some libraries (for example Go's termenv) send OSC/CSI queries and wait for a response from the terminal. Our PTY doesn't emulate those responses, so they can block on a timeout if the program insists on probing capabilities. Previously, we tried to work around this by setting `TERM=dumb` in the environment, but that caused other issues (for example, some programs (e.g cargo), disable color entirely when they see `TERM=dumb`, even if the output is actually a terminal that supports color). We intentionally do not make the child a session leader/foreground process group here. When we did, termenv detected it as foreground and ran OSC probes, which then hung.
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.
close #1362