terminal: disable terminal progress plugin on iTerm2#13897
Merged
bluetech merged 1 commit intopytest-dev:mainfrom Nov 10, 2025
Merged
terminal: disable terminal progress plugin on iTerm2#13897bluetech merged 1 commit intopytest-dev:mainfrom
bluetech merged 1 commit intopytest-dev:mainfrom
Conversation
f2316b3 to
c37e687
Compare
webknjaz
reviewed
Nov 8, 2025
Comment on lines
302
to
+311
| if reporter.isatty(): | ||
| plugin = TerminalProgressPlugin(reporter) | ||
| config.pluginmanager.register(plugin, "terminalprogress") | ||
| # Some terminals interpret OSC 9;4 as desktop notification, | ||
| # skip on those we know (#13896). | ||
| should_skip_terminal_progress = ( | ||
| # iTerm2 (reported on version 3.6.5). | ||
| "ITERM_SESSION_ID" in os.environ | ||
| ) | ||
| if not should_skip_terminal_progress: | ||
| plugin = TerminalProgressPlugin(reporter) | ||
| config.pluginmanager.register(plugin, "terminalprogress") |
Member
There was a problem hiding this comment.
This feels overly nested. How about
Suggested change
| if reporter.isatty(): | |
| plugin = TerminalProgressPlugin(reporter) | |
| config.pluginmanager.register(plugin, "terminalprogress") | |
| # Some terminals interpret OSC 9;4 as desktop notification, | |
| # skip on those we know (#13896). | |
| should_skip_terminal_progress = ( | |
| # iTerm2 (reported on version 3.6.5). | |
| "ITERM_SESSION_ID" in os.environ | |
| ) | |
| if not should_skip_terminal_progress: | |
| plugin = TerminalProgressPlugin(reporter) | |
| config.pluginmanager.register(plugin, "terminalprogress") | |
| # Some terminals interpret OSC 9;4 as desktop notification, | |
| # skip on those we know (#13896). | |
| should_skip_terminal_progress = ( | |
| # iTerm2 (reported on version 3.6.5). | |
| "ITERM_SESSION_ID" in os.environ | |
| ) or not reporter.isatty() | |
| if should_skip_terminal_progress: | |
| return | |
| plugin = TerminalProgressPlugin(reporter) | |
| config.pluginmanager.register(plugin, "terminalprogress") |
?
Member
Author
There was a problem hiding this comment.
I prefer to avoid early return in hooks because it's possible we add more unrelated stuff to it in the future.
Member
There was a problem hiding this comment.
So
Suggested change
| if reporter.isatty(): | |
| plugin = TerminalProgressPlugin(reporter) | |
| config.pluginmanager.register(plugin, "terminalprogress") | |
| # Some terminals interpret OSC 9;4 as desktop notification, | |
| # skip on those we know (#13896). | |
| should_skip_terminal_progress = ( | |
| # iTerm2 (reported on version 3.6.5). | |
| "ITERM_SESSION_ID" in os.environ | |
| ) | |
| if not should_skip_terminal_progress: | |
| plugin = TerminalProgressPlugin(reporter) | |
| config.pluginmanager.register(plugin, "terminalprogress") | |
| # Some terminals interpret OSC 9;4 as desktop notification, | |
| # skip on those we know (#13896). | |
| enable_terminal_progress = ( | |
| # iTerm2 (reported on version 3.6.5). | |
| "ITERM_SESSION_ID" not in os.environ | |
| ) and reporter.isatty() | |
| if enable_terminal_progress: | |
| plugin = TerminalProgressPlugin(reporter) | |
| config.pluginmanager.register(plugin, "terminalprogress") |
then?
Member
Author
There was a problem hiding this comment.
It messes with the comment a bit. The isatty is the more important check, but I want to have a dedicated comment for the entire "unsupported terminals" check (in case we decide to add more cases).
nicoddemus
approved these changes
Nov 10, 2025
Backport to 9.0.x: 💚 backport PR created✅ Backport PR branch: Backported as #13914 🤖 @patchback |
patchback bot
pushed a commit
that referenced
this pull request
Nov 10, 2025
terminal: disable terminal progress plugin on iTerm2 (cherry picked from commit 1ff8c9b)
bluetech
added a commit
that referenced
this pull request
Nov 10, 2025
…ff8c9b429d888e3f9020d015fa088f828899457/pr-13897 [PR #13897/1ff8c9b4 backport][9.0.x] terminal: disable terminal progress plugin on iTerm2
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.
Fix #13896