-
Notifications
You must be signed in to change notification settings - Fork 26
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
[plock-10]: Attempted fix for dropped chars #22
Conversation
# Conflicts: # src-tauri/src/main.rs
Sorry, I was going to comment on this yesterday, but it was already late at night so I decided to reply today after some sleep. Now it is late at night again :P If I understand your changes correctly, you needed to reduce the length of the chunks to 19, because you replace each
I think you could improve the workaround by using The proper fix has to be in enigo, but I don't have a suspicion where to look right now. I am also traveling and sick, so it might take some time before I look into it :/ |
@pentamassiv totally true. Great catch. |
I noticed that you removed the hack to type strings starting with a newline. However you are still splitting the strings in chunks of 19 characters. This should not be necessary. Enigo does that internally for you. |
@pentamassiv i was going to remove it, but it provides a way to cancel the operation. I haven't spent the time to come up with a better way yet 😅 - is there a concept of an interrupt signal in enigo? |
Interesting, why do you need that? I guess it is because you sometimes want to type a lot of text and it might take too long due to enigo using sleep on macOS? I'd like to get rid of the sleep and then it should be instantaneous just like on Windows so in the future there should be no need for an interrupt. |
How often do you ctrl+c in the terminal? I do it all the time. I also stop LLMs very often halfway through a response. That's what the "escape" is for. It's to stop whatever is running. If there's text streaming out, that should stop too. |
Enigo will release all held keys when you terminate the program, but that's it. Since you only enter text it does not seem relevant to your use-case though. Chunking the text is the only option there is to stop it mid way. |
(quick fix at lunch...)
@kengoodridge @pentamassiv
I managed to get it working with this approach. Note the
19
character chunks... Did not work with20
. 🤯Also the newline fix... @kengoodridge, also seemed necessary - I added a space before every newline, which fixed it for me, but checking if a
text
chunk started with one was not enough.We'll figure out the right way to get you credit @kengoodridge - maybe I'll open my PR as a modification of yours...
@pentamassiv - does this fix make any kind of sense to you?
I tried sleeps as you suggested to no avail, I also noticed the 2ms sleep was outside of the chunked loop, which seemed wrong as a HID signal was being sent, potentially with no delay.
FWIW the easiest way to reproduce this issue is to
cat
a large text file and usediff
command.