Skip to content

Conversation

@rsmmr
Copy link
Member

@rsmmr rsmmr commented Nov 21, 2025

The compact terminal output now signals test progress via OSC 9;4
escape codes.[^1] A number of terminal emulators support those these
days, and those who don't should just be ignoring them.[^2]

[^1] https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences

[^2] This comes with a work-around for older iTerm2 versions that,
rather than ignoring, would end up triggering notifications for these
escape codes instead of showing a progress bar.

@rsmmr rsmmr force-pushed the topic/robin/osc94 branch from 3a16b4e to e6da155 Compare November 21, 2025 14:39
@rsmmr
Copy link
Member Author

rsmmr commented Dec 9, 2025

Would be nice to get this into 8.1, anybody up for a review?

@bbannier
Copy link
Member

bbannier commented Dec 9, 2025

I briefly looked at this when you first put it up and was wondering why this couldn't be collected in a single, separate OutputHandler (does this even need to be a Console?). That would prevent this feature being spread all over the place. That said, I also wondered whether this would actually be worth adding at all.

@awelzel
Copy link
Contributor

awelzel commented Dec 9, 2025

That would prevent this feature being spread all over the place. That said, I also wondered whether this would actually be worth adding at all.

I think so. pytest, systemd and other tools are adding it, so why not 🤷‍♂️

@rsmmr
Copy link
Member Author

rsmmr commented Dec 9, 2025

I briefly looked at this when you first put it up and was wondering why this couldn't be collected in a single, separate OutputHandler (does this even need to be a Console?).

It's escape codes, so it needs a TTY, that's why it's inside a console, where we are printing other escape codes already as well. And it's inside the CompactConsole because limiting to that felt most natural to me as that one is already "somewhat graphical". That said, I can see creating a separate OutputHandler for it if that feels better.

That said, I also wondered whether this would actually be worth adding at all.

I find it quite useful.

@awelzel
Copy link
Contributor

awelzel commented Dec 9, 2025

And it's inside the CompactConsole because limiting to that felt most natural to me as that one is already "somewhat graphical"

Ah, can this easily be lifted into the Console one? I understood this more as having a terminal window in the background or in a separate tab and then the taskbar or the tab list shows the progress indication. For these compact vs normal should not matter.

@rsmmr
Copy link
Member Author

rsmmr commented Dec 9, 2025

Ah, can this easily be lifted into the Console one?

Yes, it can.

@rsmmr rsmmr force-pushed the topic/robin/osc94 branch from e6da155 to 0abdbde Compare December 10, 2025 11:45
@rsmmr
Copy link
Member Author

rsmmr commented Dec 10, 2025

I'm not a kitty user, but doesn't look like. I don't have LC_TERMINAL / LC_TERMINAL_VERSION here and these don't look super useful for fingerprinting.

Ok, this lets me re-consider the default-on approach. Seems potentially annoying, also given that we have two examples now where older terminal versions trigger notifications instead; there may be further ones too then. So I pushed an update that adds a new command-line option and environment variable to enable. I've switched to an output handler now as well, as that indeed works pretty well with the opt-in approach. See what you guys think.

@rsmmr rsmmr force-pushed the topic/robin/osc94 branch from 0abdbde to b8884cf Compare December 10, 2025 11:47
When running with `-P`/`----progress-bar` and the console is a TTY,
btest now now signals test progress via OSC 9;4 escape codes.[^1] A
number of terminal emulators support those these days, and those who
don't should just be ignoring them.[^2]

[^1] https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences

[^2] However, older versions of iTerm2 and Kitty (and maybe others)
are known to end up triggering notifications for these escape codes
instead of showing a progress bar.
@rsmmr rsmmr force-pushed the topic/robin/osc94 branch from b8884cf to ae4e6ad Compare December 11, 2025 09:35
@rsmmr rsmmr merged commit 376fedf into master Dec 11, 2025
21 of 22 checks passed
@rsmmr rsmmr deleted the topic/robin/osc94 branch December 11, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants