Title: Supporting the OSC 9;4 codes · Issue #14208 · PowerShell/PowerShell · GitHub
Open Graph Title: Supporting the OSC 9;4 codes · Issue #14208 · PowerShell/PowerShell
X Title: Supporting the OSC 9;4 codes · Issue #14208 · PowerShell/PowerShell
Description: 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...
Open Graph Description: 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 oper...
X Description: 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 oper...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/14208
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Supporting the OSC 9;4 codes","articleBody":"## Summary of the new feature/enhancement\r\n\r\nAs 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](https://github.com/microsoft/terminal/pull/8055)) is OS integration for visual progress indicators via `OSC9;4` ANSI codes.\r\n\r\nThe `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.\r\n\r\n## Proposed technical implementation details (optional)\r\n\r\nWhen enabled via the switch parameter or the global preference variable, `Write-Progress` will emit the following OSC codes in the following circumstances:\r\n\r\n`` `e]9;4;st;pr`e\\ ``\r\n\r\n| `st` | Description | Circumstance |\r\n| ---: | :--------------------------------- | :------------------------------------------------------------------- |\r\n| 0 | remove progress | `Write-Progress -Completed` |\r\n| 1 | set progress value to `pr` | `Write-Progress -PercentComplete \u003cpr\u003e` |\r\n| 3 | set taskbar to Indeterminate state | `Write-Progress` when no `-PercentCompleted` has been set previously |\r\n\r\nAn example of this behavior can be emulated by running the following PowerShell command in a terminal supporting the OSC `9;4` code:\r\n\r\n```ps1\r\n0..100 |% {\r\n Write-Host -NoNewline \"`e]9;4;1;$_`e\\\";\r\n Write-Progress -Activity Demo -PercentComplete $_;\r\n Start-Sleep 0.1\r\n}; Write-Host -NoNewline \"`e]9;4;0`e\\\"; Write-Progress -Activity Demo -Completed;\r\n```\r\n","author":{"url":"https://github.com/Sidneys1","@type":"Person","name":"Sidneys1"},"datePublished":"2020-11-20T17:58:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/14208/PowerShell/issues/14208"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c3993ff9-37cc-74d8-0e3a-bbc769b6f3d2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DAE8:97529:819A6A:B0634C:6A51F8EF |
| html-safe-nonce | c9fbccf78e9ff28d8e757e9007ce0ad31204da1645672716dfeaa9a46bd77575 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQUU4Ojk3NTI5OjgxOUE2QTpCMDYzNEM6NkE1MUY4RUYiLCJ2aXNpdG9yX2lkIjoiNjcxMTE3MjY3NzQwNzg0ODc5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a110b0f2136f9103a6de7ee9dcad10192df2950d3c9366dcf29b1336d54dacd1 |
| hovercard-subject-tag | issue:747691037 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/14208/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1a2a14a79a9f4627d3aa397c2d2f2ea2b521e23d45835171089e76fde7df0bd3/PowerShell/PowerShell/issues/14208 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1a2a14a79a9f4627d3aa397c2d2f2ea2b521e23d45835171089e76fde7df0bd3/PowerShell/PowerShell/issues/14208 |
| og:image:alt | 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 oper... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Sidneys1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width