Skip to content

[WIP] Rewrite paste and drag/drop broadcasting#20165

Draft
DHowett wants to merge 7 commits intodev/duhowett/fhl-2026/remove-paste-hairpin-handlerfrom
dev/duhowett/fhl-2026/rewrite-paste-and-dragdrop-handling-writeinputstring
Draft

[WIP] Rewrite paste and drag/drop broadcasting#20165
DHowett wants to merge 7 commits intodev/duhowett/fhl-2026/remove-paste-hairpin-handlerfrom
dev/duhowett/fhl-2026/rewrite-paste-and-dragdrop-handling-writeinputstring

Conversation

@DHowett
Copy link
Copy Markdown
Member

@DHowett DHowett commented Apr 30, 2026

Targets #20155.

I'm opening this to leave some notes.

co_return;
}

// TODO(DH) the fuckin' delimiter from DragDropDelimiter
return profileMenuItemFlyout;
}

static void _translatePathInPlace(std::wstring& fullPath, PathTranslationStyle translationStyle)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Move this to a helper somewhere, not into the nearly 9000-line TerminalPage

@github-actions

This comment has been minimized.

SetForegroundWindow(*_hostingHwnd);
}

if (e.DataView().Contains(StandardDataFormats::ApplicationLink()))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

per an internal PR on another feature, just like the clipboard, ENUMERATE the formats and then pick the first one we support. It lets the source app order them in its preferred manner

}

// TODO(DH) the fuckin' delimiter from DragDropDelimiter
std::unordered_map<PathTranslationStyle, winrt::hstring> translatedPaths;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the cache is too over-engineered anyway. just eat the cost of enumerating the list of filenames more than once.

return _control.CharacterDimensions();
}

TerminalApp::TerminalPaneContent TerminalPaneContent::ContentFromControl(const winrt::Microsoft::Terminal::Control::TermControl& control)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

okay the REAL reason that we need to use TerminalPaneContent instead of TermControl as the broadcast medium is that TPC knows the Profile (app layer) and Control doesn't (control layer)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the two ways I've figured out how to go from Control to Profile are:

  • this weak mapping you see here
  • enumerate every pane to find the pane whose content's control is the current control (which sounds frankly stupid)

if you have a better way to do this than either of those... plz holler

in my asciicast work, i needed to associate a third thing with each control: the Recorder instance.

Comment thread src/cascadia/TerminalApp/TerminalPage.cpp Outdated
@DHowett DHowett force-pushed the dev/duhowett/fhl-2026/rewrite-paste-and-dragdrop-handling-writeinputstring branch from 4ebafba to f42146f Compare April 30, 2026 15:18
@github-actions

This comment has been minimized.

@DHowett DHowett force-pushed the dev/duhowett/fhl-2026/rewrite-paste-and-dragdrop-handling-writeinputstring branch from f42146f to b9e56de Compare April 30, 2026 15:41
@github-actions

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants