Broadcast Input ship list #20350

Closed
opened 2026-01-31 07:11:08 +00:00 by claunia · 6 comments
Owner

Originally created by @zadjii-msft on GitHub (Aug 9, 2023).

From the 1.19.2201 Bug Bash.
x-ref:

### Tasks
- [x] `toggleBroadcastInput` isn't in the default settings
- [x] The cursors forget to keep blinking if you focus each pane and then unfocus them
- [x] They don't stop blinking when you unbroadcast
- [x] Broadcast border doesn't appear when you make new panes, but they ARE broadcasted-to!
- [ ] Broadcast doesn't work if you use context menu paste
- [ ] https://github.com/microsoft/terminal/issues/16287

dev/migrie/b/15812-broadcast-nits

Originally created by @zadjii-msft on GitHub (Aug 9, 2023). From the 1.19.2201 Bug Bash. x-ref: * #2634 * #14393 ```[tasklist] ### Tasks - [x] `toggleBroadcastInput` isn't in the default settings - [x] The cursors forget to keep blinking if you focus each pane and then unfocus them - [x] They don't stop blinking when you unbroadcast - [x] Broadcast border doesn't appear when you make new panes, but they ARE broadcasted-to! - [ ] Broadcast doesn't work if you use context menu paste - [ ] https://github.com/microsoft/terminal/issues/16287 ``` `dev/migrie/b/15812-broadcast-nits`
claunia added the Issue-BugNeeds-Tag-FixProduct-TerminalArea-UserInterface labels 2026-01-31 07:11:09 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Sep 5, 2023):

I've read the original PR like, 15 times and I cannot for the life of me find where it actually enables blinking cursors for inactive, broadcasted panes

@zadjii-msft commented on GitHub (Sep 5, 2023): I've read the original PR like, 15 times and I cannot for the life of me find where it actually enables blinking cursors for inactive, broadcasted panes
Author
Owner

@zadjii-msft commented on GitHub (Sep 18, 2023):

  • TermControl::_PasteCommandHandler is called for the context menu. (The same path is followed for the normal r-click paste)
    • ControlInteractivity::RequestPasteTextFromClipboard raises a PasteFromClipboard event
      • handled in TerminalPage::_PasteFromClipboardHandler
        • Calls the event's HandleClipboardData() property
          • calls to ControlInteractivity::_sendPastedTextToConnection
            • calls ControlCore::PasteText

BUT

TermControl::_pasteTextWithBroadcast is only on TermControl (while the rest of that madness occurs in TerminalPage and ControlInteractivity). GAH.


When we do a paste action (TerminalPage::_PasteText), we just have every control in the tab do a TermControl::PasteTextFromClipboard, which does a _interactivity.RequestPasteTextFromClipboard. The app is orchestrating them all asking for the clipboard contents.

@zadjii-msft commented on GitHub (Sep 18, 2023): * `TermControl::_PasteCommandHandler` is called for the context menu. (The same path is followed for the normal r-click paste) * `ControlInteractivity::RequestPasteTextFromClipboard` raises a `PasteFromClipboard` event * handled in `TerminalPage::_PasteFromClipboardHandler` * Calls the event's `HandleClipboardData()` property * calls to `ControlInteractivity::_sendPastedTextToConnection` * calls `ControlCore::PasteText` BUT `TermControl::_pasteTextWithBroadcast` is only on TermControl (while the rest of that madness occurs in TerminalPage and ControlInteractivity). GAH. ---- When we do a `paste` action (`TerminalPage::_PasteText`), we just have every control in the tab do a `TermControl::PasteTextFromClipboard`, which does a `_interactivity.RequestPasteTextFromClipboard`. The app is orchestrating them all asking for the clipboard contents.
Author
Owner

@zadjii-msft commented on GitHub (Sep 18, 2023):

a dumb solution:

  • don't have the app orchestrate telling all the broadcasted-to panes ask for a paste on paste.
  • INSTEAD on ControlInteractivity::_sendPastedTextToConnection, raise a StringSent to TermControl.
    • TermControl can then check if it's got _StringSentHandlers and re-raise if needed

I feel like that's how it was originally done in an earlier form of #14393...

@zadjii-msft commented on GitHub (Sep 18, 2023): a dumb solution: * don't have the app orchestrate telling all the broadcasted-to panes ask for a paste on paste. * INSTEAD on `ControlInteractivity::_sendPastedTextToConnection`, raise a `StringSent` to `TermControl`. * `TermControl` can then check if it's got `_StringSentHandlers` and re-raise if needed I feel like that's how it was originally done in an earlier form of #14393...
Author
Owner

@DHowett commented on GitHub (Sep 18, 2023):

I remember we were talking about adding an API to TermControl along the lines of WriteString(Source, String), where Source would control whether it was (1) bracketed (2) stripped of control sequences (3) etc. Like, "Pasted" strings got the configured treatment, Raw or Input or whatever strings get no treatment at all.

That would afford us the ability to add Source::Broadcast (as a flag(!)), funnel almost all inputs through WriteString, and not accidentally rebroadcast broadcast strings.

@DHowett commented on GitHub (Sep 18, 2023): I remember we were talking about adding an API to TermControl along the lines of `WriteString(Source, String)`, where `Source` would control whether it was (1) bracketed (2) stripped of control sequences (3) etc. Like, "Pasted" strings got the configured treatment, `Raw` or `Input` or whatever strings get no treatment at all. That would afford us the ability to add `Source::Broadcast` (as a flag(!)), funnel almost all inputs through WriteString, and not accidentally rebroadcast broadcast strings.
Author
Owner

@zadjii-msft commented on GitHub (Sep 18, 2023):

okay something else I tried: 35aba0cdc

even simpler than before. The way this is layered:

  • TerminalPage will only be asked to look up the clipboard once
  • It will apply the paste warnings as needed. One time.
  • Then, it'll write it to the control that asked for the paste's callback.
  • The control itself will then StringSent that text to the other controls.
    • The sending control does get to do the bracketed paste thing
    • The others however just get the RawWriteString. That ends up in a non-bracketed paste
      • uhg okay, so I would need to send the source with the StringSentEventArgs. That'll pollute the tree a bit...
@zadjii-msft commented on GitHub (Sep 18, 2023): okay something else I tried: 35aba0cdc even simpler than before. The way this is layered: * TerminalPage will only be asked to look up the clipboard once * It will apply the paste warnings as needed. One time. * Then, it'll write it to the control that asked for the paste's callback. * The control itself will then `StringSent` that text to the other controls. * The sending control does get to do the bracketed paste thing * The others however just get the `RawWriteString`. That ends up in a non-bracketed paste * uhg okay, so I would need to send the `source` with the `StringSentEventArgs`. That'll pollute the tree a bit...
Author
Owner

@zadjii-msft commented on GitHub (Sep 4, 2024):

Closing since there's only one thing left in here (and we've shipped a couple times with that one thing)

@zadjii-msft commented on GitHub (Sep 4, 2024): Closing since there's only one thing left in here (and we've shipped a couple times with that one thing)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20350