AIMindLink commited on
Commit
27e81b8
·
verified ·
1 Parent(s): 95f3fc1

Upload main.py

Browse files

Changed /past command to no longer trigger a second request

Files changed (1) hide show
  1. main.py +9 -0
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: