GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — Add UseOSCIndicator setting to enable progress indicator in terminal by SteveL-MSFT · Pull Request #14927 · PowerShell/PowerShell Conversation
|
|
Whilst one wouldn't want things special cased and hard-coded to terminals, one can actually detect if PowerShell is hosted within ConEmu via environment variables. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Christoph Bergmeister (@bergmeister) does ConEmu have a big enough customer base to warrant such code? Also, does every version of ConEmu support it? In the case of Windows Terminal, we'd have to check that it's newer than a specific version to turn it on by default. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Steve Lee (@SteveL-MSFT) Christoph Bergmeister (@bergmeister) I worry about doing automatic terminal detection being a slippery slope of the team having to support all kinds of terminal quirks long-term, when it's easy enough to do the detection in a user profile. Especially when being done with something as arbitrary as environment variables vs. some sort of standard cross-platform terminal feature detection process (which doesn't exist to my knowledge) This kind of detection could also easily be done in a separate module that manages PSStyle, I don't think it should be part of the core PS codebase however. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
df71565 to
18cc947
Compare
|
Steve Lee (@SteveL-MSFT) It would be nice if you can add screenshot or GIF to show how this looks in Windows Terminal. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| // OSC sequence to turn on progress indicator | ||
| // https://github.com/microsoft/terminal/issues/6700 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is there an official document for the OSC sequences supported in Windows Terminal?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
None I could find other than the github issue
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…e.cs Co-authored-by: Dongbo Wang <[email protected]>
|
Dongbo Wang (@daxian-dbw) added a gif, you can see it in the upper left of the tab. It's just a little circle that fills in based on % complete |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
$PSStyle.Progress.UseOSCIndicator to enable progress indicator in terminal|
Changed PR title so that changelog generation script won't have problems with it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🎉 Handy links: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Given that the OSC progress indicator is a "write-only" thing, there are a number of scenarios where the result is not what one would expect IMVHO:
This can be experimented with something like this: param([int] $Count = 10, [int] $Delay = 10, [switch] $Archive) for ($i=0; $i -lt $Count; $i++) { Write-Host ("{0}/{1}" -f $i, $Count) Write-Progress -Activity 'Activity' -Status 'Status' -PercentComplete (100 * ($i+1) / $Count) if ($Archive) { Remove-Item c:/tmp/foo.zip -ea 0 Compress-Archive -destination c:/tmp/foo.zip C:\Users\steph\OneDrive\Images\*.cr2 } Start-Sleep -Seconds $Delay } Write-Progress -Activity 'Activity' -Status 'Status' -Completed I think what we need is some global stack-based encapsulation of the indicator, where the latest desired indicator is "pushed" to the top of the stack, and the indicator is restored to the previous state on a "pop" operation. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This needs to be solved for all nested and coterminous progress operations regardless of OSC indication. OSC indication being mixed up is only one symptom of the underlying issue. 😄 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Where is discussed / tracked? Are the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.