Add settings for "notifying" on "activity"#20014
Add settings for "notifying" on "activity"#20014carlos-zamora wants to merge 3 commits intodev/cazamor/toast/basefrom
Conversation
4357c17 to
aeb531f
Compare
09c47c6 to
98a4ccb
Compare
|
Tested this out, it's pretty cool. The only thing I can think of is the possibility of adding the So yeah, marked this as ready for review. Enjoy y'all! 😊 |
90fdd9b to
fbb886e
Compare
| "description": "Sets the sound played when the application emits a BEL. When set to an array, the terminal will pick one of those sounds at random.", | ||
| "$ref": "#/$defs/BellSound" | ||
| }, | ||
| "notifyOnInactiveOutput": { |
There was a problem hiding this comment.
What about a setting for duration? Ghostty has this as well. I may only want to see this after, say, 10s and not a command that maybe takes a second and I quickly flip away intending to come back in a few seconds. A longer job is more likely something we'll "walk away from" for a longer period instead of just flipping windows back and forth a bit.
If someone really wanted to be alerted for every command when the window is inactive, they can set this to 0 (or maybe that's the default).
There was a problem hiding this comment.
Hmm... ghostty calls these settings activity-monitor and activity-monitor-threshold. So, we could name this notifyOnInactiveOutputThreshold and also have it take an int representing seconds (default of 0). Then just place them next to each other in the settings UI.
There was a problem hiding this comment.
Having a higher default (IIRC, Ghostty's is 30s when enabled) might solve the other issue you mentioned, but you could also debounce notifications. If they come in within Xs (maybe also configurable), don't notify. Frankly, given the goal is to notify you some task is done - and this would seem to be a long-running task, IMO, since any quick task you're probably coming back to frequently - the "threshold" having a higher default like 30s would probably be sufficient - at least as a start.
|
I was just using this feature with Copilot, and it was sending a ton of notifications as it was thinking. Thoughts? CC @DHowett @zadjii-msft |
|
IMO: I think we need to send one notification when the tab gets activity and then no more until that pane is focused. Like, consider how the in-tab indicator would work. It's like the bell icon. "this tab did a thing" stays until the user activates it to dismiss that state. |
This PR implements the proposal in this comment. It adds 3 settings:
notifyOnInactiveOutput: send a "notification"(below) of some kind when an inactive tab has new output.notifyOnNextPrompt: Similarly, but when we get a new prompt start (requires shell integration)autoDetectRunningCommand: attempt to automatically detect the progress state of this profileFor the
notifyOn*settings, they take any combination of the following flags:tab: flash the taskbaraudible: emit an audible bell (This will use the sounds from bellSounds, if specified)taskbar: display an icon in the tab (ala terminal activity indicator/alert when in background #7955 (comment) ) (basically, similar to the bell icon)notification: send a desktop "toast" (read: notification). Clicking that notification will focus the tab that sent itFor the
autoDetectRunningCommandsetting, we support:disabled: don't do thisautomatic: (requires shell integration) if we got a FTCS_COMMAND_EXECUTED (133;C), then any output, set our progress state to indeterminateValidated using this config:
notifyOnInactiveOutput)notifyOnNextPrompt)autoDetectRunningCommand)Heavily based on #19935
Co-authored by @zadjii-msft