Skip to content

Commit

Permalink
Fix double paste when CF_UNICODETEXT & CF_HDROP are present (#17543)
Browse files Browse the repository at this point in the history
Well, this one is rather simple. :)
tl;dr: We shouldn't call `StringPaste` twice for the same paste.

Closes MSFT:51822029
  • Loading branch information
lhecker authored Jul 12, 2024
1 parent 04c33f3 commit 8c6eaad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/interactivity/win32/Clipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ void Clipboard::Paste()
// NOTE: Some applications don't add a trailing null character. This includes past conhost versions.
const auto maxLen = GlobalSize(handle) / sizeof(wchar_t);
StringPaste(str, wcsnlen(str, maxLen));
return;
}

// We get CF_HDROP when a user copied a file with Ctrl+C in Explorer and pastes that into the terminal (among others).
Expand Down

0 comments on commit 8c6eaad

Please sign in to comment.