Upload main.py
Browse filesChanged /past command to no longer trigger a second request
main.py
CHANGED
|
@@ -394,6 +394,15 @@ def _cmd_paste(arg: str) -> str | None:
|
|
| 394 |
return None
|
| 395 |
_content = "\n".join(_lines)
|
| 396 |
print(f" └─ Paste done ({len(_lines)} lines, {len(_content)} chars){c.res}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 397 |
return _content
|
| 398 |
|
| 399 |
def _cmd_history(arg: str) -> None:
|
|
|
|
| 394 |
return None
|
| 395 |
_content = "\n".join(_lines)
|
| 396 |
print(f" └─ Paste done ({len(_lines)} lines, {len(_content)} chars){c.res}")
|
| 397 |
+
|
| 398 |
+
# Drain stray inputs the background listener captured during paste
|
| 399 |
+
time.sleep(0.05)
|
| 400 |
+
while not input_queue.empty():
|
| 401 |
+
try:
|
| 402 |
+
input_queue.get_nowait()
|
| 403 |
+
except queue.Empty:
|
| 404 |
+
break
|
| 405 |
+
|
| 406 |
return _content
|
| 407 |
|
| 408 |
def _cmd_history(arg: str) -> None:
|