You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the LLM leads to some delay and might result in another window having the focus when the text is pasted, causing unintended actions.
It would be good to save the window that is currently focused before running the LLM and check if it still has the focus when pasting the result. In the best case one could check if the right textarea is selected, but I would currently not know a way to do this.
In an own project for Linux I use:
window_id=run_piped(["xdotool", "getactivewindow"])
# Run some code like waiting for the LLM to return a resultwindow_id2=run_piped(["xdotool", "getactivewindow"])
ifwindow_id2!=window_id:
print("active window changed. Aborting.")
return
I am not sure what's the Windows equivalent and there may also be a pure python approach to that, but I think the general idea of checking if the window is the same would help to prevent chaos when the user doesn't wait for the result. A fallback action when the window changed could be to show a dialog window with the result, so the user can copy & paste it into the right window.
Activity
Add focus-change paste safety (theJayTea#23), per-app copy/paste chor…