-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
sendInput
should be previewable
#12861
Comments
More cleanly pulled to its own branch: https://github.com/microsoft/terminal/pull/new/dev/migrie/f/12861-preview-input Note: You'll also want the backspace trimming thing. That merged into TSFControl in 0f32692 but I don't know where its origin was before that. void TSFInputControl::ManuallyDisplayText(const winrt::hstring& text)
{
_focused = !text.empty();
Canvas().Visibility(text.empty() ? Visibility::Collapsed : Visibility::Visible);
_inputBuffer.clear();
// _editContext.NotifyFocusLeave();
_activeTextStart = 0;
_inComposition = false;
// HACK trim off leading DEL chars.
std::wstring_view view{ text.c_str() };
const auto strBegin = view.find_first_not_of(L"\x7f");
if (strBegin != std::wstring::npos)
{
view = view.substr(strBegin * 2);
}
TextBlock().Text(winrt::hstring{ view });
TextBlock().UpdateLayout();
TryRedrawCanvas();
} |
Curious how this will handle |
Protip, revert 7c3fd2a I backed it out because it:
you may also need 8f0b6f8 |
Punting out of 1.19. This was wacky as-is. We may want to come back to re-try this with more runway. |
This adds support for previewing snippets, again. This time, with the new TSF implementation. Leonard pointed me in the right direction with this - he's the one who suggested to have a second `Composition` just for previews like this. Then we do some tricky magic to make it work when we're using commandlines from shell integration, or you've got the ghost text from powershell, etc. Then we visualize the control codes, just so they aren't just U+FFFE diamonds. Closes #12861
See #9818, 60f63b0, #3121. I literally have this prototyped, just need to check it in. It's important for future issues...
The text was updated successfully, but these errors were encountered: