terminal
terminal copied to clipboard
Broadcast Input ship list
From the 1.19.2201 Bug Bash. x-ref:
- #2634
- #14393
### 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
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
TermControl::_PasteCommandHandleris called for the context menu. (The same path is followed for the normal r-click paste)ControlInteractivity::RequestPasteTextFromClipboardraises aPasteFromClipboardevent- handled in
TerminalPage::_PasteFromClipboardHandler- Calls the event's
HandleClipboardData()property- calls to
ControlInteractivity::_sendPastedTextToConnection- calls
ControlCore::PasteText
- calls
- calls to
- Calls the event's
- handled in
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.
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 aStringSenttoTermControl.TermControlcan then check if it's got_StringSentHandlersand re-raise if needed
I feel like that's how it was originally done in an earlier form of #14393...
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.
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
StringSentthat 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
sourcewith theStringSentEventArgs. That'll pollute the tree a bit...
- uhg okay, so I would need to send the