Proof of concept: concurrent progress bars#819
Conversation
|
Noting that, via this entry point, this is only possible in Positron (and not RStudio). |
|
Cool, so the R console in Positron now supports ANSI control sequences? All of them? How does one learn about this? How could we detect this? |
|
Okay, just did some exploration. Positron's R console uses a custom ANSI renderer. It supports:
These ones are not supported (silently consumed):
The needed biys were all present in the earliest commit to that file, in October 2023 (aeef2f28). This was before |
I am afraid that's probably not true, because env vars are inherited, so e.g. a job in the job pane will have |
|
This is probably unique to Positron, though: |
There was a problem hiding this comment.
Can you write some summary about how this actually works? E.g. why do we need status_bar_lines (isn't that the length of status_bar?), what is status_bar_prev_content, etc?
Never mind, I understand it now.
We'll probably also need an opt-out mechanism, but we can do that later.
|
One thing I am not sure about is whether this should apply to status bars. (Which maybe nobody uses...) A status bar is just one line, even in a GUI. |
Also add an `R_CLI_ANSI` env var.
On Windows a subprocess will have `is_ansi_tty() = TRUE` now if the main process is running in a terminal. That's the price for supporting ANSI constrol sequences on Windows. We'll see if we need an update for this later.
|
@simonpcouch Thanks for the great PR! |
|
Awesome, thanks for sprucing this up! Excited to have this in. |
Related to #818. Largely vibe-coded and not intended to be merged--just a proof of concept.
A simple example in Positron:
simple-concurrent-progress-bars.mov