question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supporting the OSC 9;4 codes

See original GitHub issue

Summary of the new feature/enhancement

As a user I want PowerShell to integrate with terminal features where it makes sense, especially when the terminal is providing integration with the host operating system. One such feature supported by ConEmu and Windows Terminal (as of 2020-11-18) is OS integration for visual progress indicators via OSC9;4 ANSI codes.

The Write-Progress cmdlet should optionally emit a ConEmu-style OSC 9;4 progress ANSI code, controlled by a switch parameter like -EmitAnsiProgress, and default to a global variable like $EmitAnsiProgressPreference so that it can be enabled profile-wide.

Proposed technical implementation details (optional)

When enabled via the switch parameter or the global preference variable, Write-Progress will emit the following OSC codes in the following circumstances:

`e]9;4;st;pr`e\

st Description Circumstance
0 remove progress Write-Progress -Completed
1 set progress value to pr Write-Progress -PercentComplete <pr>
3 set taskbar to Indeterminate state Write-Progress when no -PercentCompleted has been set previously

An example of this behavior can be emulated by running the following PowerShell command in a terminal supporting the OSC 9;4 code:

0..100 |% {
  Write-Host -NoNewline "`e]9;4;1;$_`e\";
  Write-Progress -Activity Demo -PercentComplete $_;
  Start-Sleep 0.1
}; Write-Host -NoNewline "`e]9;4;0`e\"; Write-Progress -Activity Demo -Completed;

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
DHowettcommented, Mar 12, 2021

Something similar to–or exactly matching–this just landed with #14927

0reactions
Sidneys1commented, Mar 12, 2021

I’d say this is adequately resolved, thanks for following up @DHowett!

Read more comments on GitHub >

github_iconTop Results From Across the Web

New GASB Standards
Additionally, New York State must implement GASBS 94, Public-Private Partnerships and Public-Public Partnerships, in fiscal year 2023-24 annual financial ...
Read more >
National Instrument 94-102 Derivatives: Customer Clearing ...
Under Part 6 of the Instrument, regulated clearing agencies are required to keep certain records and supporting documentation as well as keep ...
Read more >
USERRA Overview
​The Uniformed Services Employment and Reemployment Rights Act (USERRA) is a federal law, passed in 1994, that protects military service members and ...
Read more >
Section 8A - Master File Codes - Transaction, MF and IDRS
Transaction codes that are unique to IDRS are also included. ... Child Support Enforcement ... 94, 95 or 96, 98, 99 required to...
Read more >
ANSI escape code
ANSI escape sequences are a standard for in-band signaling to control cursor location, color, font styling, and other options on video text terminals...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found