Skip to content

Add settings for "notifying" on "activity"#19935

Open
zadjii-msft wants to merge 11 commits intomainfrom
dev/migrie/fhl-spring26/activity-notifications
Open

Add settings for "notifying" on "activity"#19935
zadjii-msft wants to merge 11 commits intomainfrom
dev/migrie/fhl-spring26/activity-notifications

Conversation

@zadjii-msft
Copy link
Member

This PR basically implements what I proposed in this comment(#7955 (comment)). It adds three 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 profile

the "notifications" of the notifyOn* settings take a flags enum of tab|audible|taskbar|notification, which can be combined as you want. Their meanings are:

  • taskbar: flash the taskbar
  • audible: emit an audible bell (This will use the sounds from bellSounds, if specified)
  • tab: 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 it

and then for autodetect running commands, we only support:

  • disabled (default): don't do this
  • automatic: (requires shell integration) if we got a FTCS_COMMAND_EXECUTED  (133;C), then any output, set our progress state to indeterminate
  • I didn't end up implementing progress, because walking the buffer sounded... not great.
  • most of this is from this 2023 branch

Profiles to test with:

"defaults":
{
	"autoDetectRunningCommand": "automatic",
	"autoMarkPrompts": true, // Needed even when your OMP config has shell integration enabled
	"rightClickContextMenu": true,
	"showMarksOnScrollbar": true
},
"list":
[
	{
		"commandline": "pwsh -nologo",
		"name": "inactive output",
		"notifyOnInactiveOutput":
		[
			"taskbar",
			"audible",
			"tab",
			"notification"
		]
	},
	{
		"commandline": "pwsh -nologo",
		"name": "Next Prompt",
		"notifyOnNextOutput":
		[
			"taskbar",
			"audible",
			"tab",
			"notification"
		]
	},

@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. labels Mar 4, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

};

[flags]
enum OutputNotificationStyle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These enums and the properties that use them are not consumed by TermControl; it seems like they are an app level concern and should not be present in the TermControl layer.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(fwiw noted)

}

// Method Description:
// - Raised when output stops being produced for ~100ms (debounced).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an implementation detail. also, isn't 100ms actually casually insane for something that should notify the user? the segments of a user's prompt might take that long to print

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Mar 5, 2026
@DHowett
Copy link
Member

DHowett commented Mar 5, 2026

In general, I think I would prefer one PR that adds the notification infrastructure so that all the PRs can be stacked on top of that one, rather than them all depending on possibly the most contentious one of the stack.

Ergo,

Add notification infrastructure
|- add activity
|- add bell
|- add AUMID
|- add OSC777

rather than

Add activity notifier and notification infrastructure
|- add bell
   |- add aumid
      |- add OSC 777

@zadjii-msft
Copy link
Member Author

rather than them all depending on possibly the most contentious one of the stack.

this is a totally reasonable take. I can work on that.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Attention The core contributors need to come back around and look at this ASAP. Product-Terminal The new Windows Terminal.

Projects

None yet

2 participants