Conversation
|
|
||
| /** progress object interface */ | ||
| export interface IProgress { | ||
| state: 0 | 1 | 2 | 3 | 4; |
There was a problem hiding this comment.
Could pull this into type ProgressState?
There was a problem hiding this comment.
Solved this by adding:
import type { ProgressState } from '../src/ProgressAddon';It feels abit like a bad hack (cyclic import?), but works locally.
There was a problem hiding this comment.
We shouldn't be referencing src from typing files. The more isolated the better as otherwise it can cause huge problems since libraries will suddenly be looking at and maybe linting against our source code, not just the types.
There was a problem hiding this comment.
Hmm yeah, good point. Gonna try to find a better workaround. Sadly enums are tricky to use with d.ts files.
|
@Tyriar applied your remarks, up for review again. |
|
@Tyriar Found a way to borrow the emitter ctor from xterm until #5283 is resolved. With this change things are back to normal with only 1.4kB minified 💪 : |
Tyriar
left a comment
There was a problem hiding this comment.
Looks great, just some small polish things
| }); | ||
| // FIXME: borrow emitter ctor from xterm, to be changed once #5283 is resolved | ||
| this._onChange = new (terminal as any)._core._onData.constructor(); | ||
| this.onChange = this._onChange!.event; |
There was a problem hiding this comment.
Doesnt work without. My guess - the any cast above keeps the undefined as part of the type, so TS doesnt see this as undefined-guarded here.
Co-authored-by: Daniel Imms <[email protected]>
| * Progress state tracked by the addon. | ||
| */ | ||
| export interface IProgressState { | ||
| state: 0 | 1 | 2 | 3 | 4; |
There was a problem hiding this comment.
@Tyriar Tried using a const enum inside the d.ts - this worked fine for TS itself and webpack build, but not with esbuild. So I changed it back to that integer union thingy. (Btw that plain union type is easier to understand for JS folks...)
Tyriar
left a comment
There was a problem hiding this comment.
👏
Will try adopt in vscode now microsoft/vscode#237564
|
FYI in case you didn't see this kovidgoyal/kitty#8011 (comment) |
|
I see winget uses indeterminate progress, do you know of another application that implements value/% based? (cargo coming soon) |
Yeah, thats the reason why I had to exclude handling of OSC 9 that dont continue with
Nope, I dont. Systemd prolly uses that, but no clue in windows world. |
|
@Tyriar Yeah, debouncing might be needed. The sequence isnt all that good in its spec - it is also unclear, how long to show the progress indicator or when to remove it (I'd guess that it should be removed after some time of inactivity, or after a window focus toggle etc) |
|
In my implementation I considered clearing the state after a command is run. I guess it's kind of a necessity if the proc crashes/ctrl+c doesn't handle it, etc. |
|
I guess it needs a timeout running down, as we never know for sure when the terminal client app crashed or gave up for whatever reason. |
|
I have it clearing when shell integration tells us any command finished: microsoft/vscode@86b257e Seems like a fairly safe thing to do |


This addon implements ConEmu's progress sequence, for more context see #5250.
The addon tries to hide most of the sequence's shenanigans behind a convenient API:
Fixes #5250.