diff --git a/CHANGELOG.md b/CHANGELOG.md index df3fadf4f2..40d10bbdb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed relative units in `grid-rows` and `grid-columns` being computed with respect to the wrong dimension https://github.com/Textualize/textual/issues/1406 - Programmatically setting `overflow_x`/`overflow_y` refreshes the layout correctly https://github.com/Textualize/textual/issues/1616 - Fixed double-paste into `Input` https://github.com/Textualize/textual/issues/1657 +- Added a workaround for an apparent Windows Terminal paste issue https://github.com/Textualize/textual/issues/1661 ## [0.10.1] - 2023-01-20 diff --git a/src/textual/_xterm_parser.py b/src/textual/_xterm_parser.py index 1bbec555d6..b97a1abd1b 100644 --- a/src/textual/_xterm_parser.py +++ b/src/textual/_xterm_parser.py @@ -118,7 +118,10 @@ def reissue_sequence_as_keys(reissue_sequence: str) -> None: # ESC from the closing bracket, since at that point we didn't know what # the full escape code was. pasted_text = "".join(paste_buffer[:-1]) - on_token(events.Paste(self.sender, text=pasted_text)) + # Note the removal of NUL characters: https://github.com/Textualize/textual/issues/1661 + on_token( + events.Paste(self.sender, text=pasted_text.replace("\x00", "")) + ) paste_buffer.clear() character = ESC if use_prior_escape else (yield read1())