Skip to content

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

Draft
DHowett wants to merge 7 commits into
dev/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 into
dev/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 has been minimized.

@DHowett DHowett force-pushed the dev/duhowett/fhl-2026/rewrite-paste-and-dragdrop-handling-writeinputstring branch from b9e56de to 17cdf29 Compare May 15, 2026 01:11
@github-actions
Copy link
Copy Markdown

@check-spelling-bot Report

⚠️ Dictionary not found

Problems were encountered retrieving check dictionaries (cspell:ada/dict/ada.txt cspell:css/dict/css.txt cspell:lua/dict/lua.txt cspell:python/src/python/python-lib.txt cspell:cpp/src/people.txt cspell:python/src/additional_words.txt cspell:r/src/r.txt cspell:docker/src/docker-words.txt cspell:haskell/dict/haskell.txt cspell:html/dict/html.txt cspell:software-terms/dict/softwareTerms.txt cspell:rust/dict/rust.txt cspell:python/src/python/python.txt cspell:python/src/common/extra.txt cspell:clojure/src/clojure.txt cspell:latex/dict/latex.txt cspell:cpp/src/ecosystem.txt cspell:redis/dict/redis.txt cspell:typescript/dict/typescript.txt cspell:cpp/src/stdlib-cpp.txt cspell:cpp/src/template-strings.txt cspell:scala/dict/scala.txt cspell:swift/src/swift.txt cspell:java/src/java-terms.txt cspell:node/dict/node.txt cspell:cpp/src/stdlib-c.txt cspell:cpp/src/lang-keywords.txt cspell:cpp/src/compiler-clang-attributes.txt cspell:golang/dict/go.txt cspell:elixir/dict/elixir.txt cspell:sql/src/sql.txt cspell:gaming-terms/dict/gaming-terms.txt cspell:k8s/dict/k8s.txt cspell:sql/src/tsql.txt cspell:public-licenses/src/generated/public-licenses.txt cspell:shell/dict/shell-all-words.txt cspell:monkeyc/src/monkeyc_keywords.txt cspell:cpp/src/compiler-msvc.txt cspell:dotnet/dict/dotnet.txt cspell:django/dict/django.txt cspell:software-terms/dict/webServices.txt cspell:powershell/dict/powershell.txt cspell:public-licenses/src/additional-licenses.txt cspell:svelte/dict/svelte.txt cspell:cpp/src/stdlib-cmath.txt cspell:php/dict/php.txt cspell:cpp/src/compiler-gcc.txt cspell:ruby/dict/ruby.txt cspell:fullstack/dict/fullstack.txt cspell:cpp/src/stdlib-cerrno.txt cspell:dart/src/dart.txt cspell:java/src/java.txt cspell:npm/dict/npm.txt cspell:cpp/src/lang-jargon.txt).

⚠️ For more information, see check-dictionary-not-found.

🔴 Please review

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

Unrecognized words (1)

fuckin

To accept these unrecognized words as correct, you could run the following commands

... in a clone of the git@github.com:microsoft/terminal.git repository
on the dev/duhowett/fhl-2026/rewrite-paste-and-dragdrop-handling-writeinputstring branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/25894745184/attempts/1' &&
git commit -m 'Update check-spelling metadata'
Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (2010) from .github/actions/spelling/expect/alphabet.txt .github/actions/spelling/expect/expect.txt .github/actions/spelling/expect/web.txt and unrecognized words (1)

Dictionary Entries Covers Uniquely
cspell:csharp/csharp.txt 32 2 2
cspell:aws/aws.txt 232 2 2
cspell:fonts/fonts.txt 536 1 1

Consider adding to the extra_dictionaries array (in the .github/actions/spelling/config.json file):

    "cspell:csharp/csharp.txt",
    "cspell:aws/aws.txt",
    "cspell:fonts/fonts.txt",

To stop checking additional dictionaries, put (in the .github/actions/spelling/config.json file):

"check_extra_dictionaries": []
Warnings ⚠️ (1)

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

⚠️ Warnings Count
⚠️ check-dictionary-not-found 54

See ⚠️ Event descriptions for more information.

✏️ Contributor please read this

By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.

If the listed items are:

  • ... misspelled, then please correct them instead of using the command.
  • ... names, please add them to .github/actions/spelling/allow/names.txt.
  • ... APIs, you can add them to a file in .github/actions/spelling/allow/.
  • ... just things you're using, please add them to an appropriate file in .github/actions/spelling/expect/.
  • ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in .github/actions/spelling/patterns/.

See the README.md in each directory for more information.

🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

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