Merge pull request #1665 from davep/workaround-windows-paste

Workaround for a Windows paste issue
This commit is contained in:
Dave Pearson
2023-01-25 14:52:59 +00:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -118,7 +118,10 @@ class XTermParser(Parser[events.Event]):
# 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())