Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for broadcasting to all panes in a tab #14393
Add support for broadcasting to all panes in a tab #14393
Changes from all commits
c1fb748
1651994
8862ed8
d685c12
e21b6bb
8abe995
c1c002a
e29dc40
0136994
8d7c1ea
8a89d81
1813a42
521fdea
0627f8f
6ac4579
2860b4e
95dba3d
8894d80
0c9821c
20976f7
c1e4b7d
a5e66e2
fb90f25
7d2e6ad
2fb183a
bea849a
1a5852d
3cdb3db
aad2b68
5a78021
2dce177
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idle thought... should this not go via the same path as RawWriteString? PasteTextFromClipboard means "ask the app for the clipboard content," which could result in one ContentDialog per control (!) confirming the paste.
I'd expect this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note from discussion: bracketed paste, make sure that works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. This is... less trivial.
TerminalPage::_PasteFromClipboardHandler
calls the event'sHandleClipboardData
, which is a callback thatInteractivity
set up to call_core->PasteText
1 when the paste is completed. However, Core & Interactivity don't actually know anything about broadcast mode. That's all good and well.I suppose this could be done by finagling the paste handling a bit. We'd bubble up to TermControl, it'd register the paste callback itself, and in its own handler it could decide to re-raise a
event Windows.Foundation.TypedEventHandler<Object, StringSentEventArgs> PasteSent;
2, which pane could listen to, and then propagate. Feels kinda extra dirty, tbh.I don't think the dialog will pop multiple times, on account of the fact that there can only ever be one dialog. I'll have to validate that though.
Alternatively, we could do the broadcast check inside
TerminalPage::_PasteFromClipboardHandler
and just callWalkTree([text](){ p->Control().PasteText(); });
and plumb that through.Might be tricky to determine that though.well, I suppose if we're not in broadcast mode, we could just call the event callback as before.TermControl
doesn't expose theInteractivity
out of it, so we couldn't compare thesender
Thoughts?
Footnotes
core->PasteText
is what handles bracketed paste, so that's fine. ↩can't be the StringSent, cause we do need to special-case pastes ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DHowett gibe thoughts pls, so I can merge this when I get back from break for 1.19 selfhost☺️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We chatted last-ish week about RawWriteString taking a "StringKind" of Clipboard, Raw, Whatever. Noting that here to close the loop. :)