Skip to content

GH-130328: Speedup pasting in legacy console on Windows #133728

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

chris-eibl
Copy link
Member

@chris-eibl chris-eibl commented May 9, 2025

for i in range(rec_count):
rec = recs[i]
# In case of a legacy console, we do not only receive a keydown
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, there is a lot of duplicated logic from get_event now. Maybe refactor that, so the logic can be reused here?

@@ -449,8 +442,11 @@ def get_event(self, block: bool = True) -> Event | None:
and there is no event pending, otherwise waits for the
completion of an event."""

if not block and not self.wait(timeout=0):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved blocking and waiting logic into get_event like in unix_console.py. IMHO that shouldn't be part of reading and we're in perfect sync with Unix now.

@@ -484,7 +491,6 @@ def do(self) -> None:
data = ""
start = time.time()
while done not in data:
self.reader.console.wait(100)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is needed. Works for me without it. For both, Linux and Windows, this will immediately return in case of pending data, and just needlessly waits 100 ms if there is no more data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant