Skip to content
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

Buffer too small #7

Closed
Zerogaku opened this issue May 6, 2024 · 2 comments
Closed

Buffer too small #7

Zerogaku opened this issue May 6, 2024 · 2 comments

Comments

@Zerogaku
Copy link

Zerogaku commented May 6, 2024

I'm having the same problem as this issue, it seems I can only run window tools manuall from the terminal as starting it from my autohotkey script will result in it instantly crashing, but even if I run it manually, for some reason, clicking the windows menu icon with my mouse causes it to instantly crash, like something is triggering it for some reason.
image

reidprichard added a commit that referenced this issue May 6, 2024
@reidprichard
Copy link
Owner

Interesting. I can't fathom why running via AHK would be an issue, and I wasn't able to reproduce that on my end with a simple example:

SetWinDelay 0
SendMode("Input")
ProcessSetPriority("H")
SetWorkingDir(A_ScriptDir)

a:: {
	Run "./kanata_helper_daemon.exe -p 1337"
}

The above worked without issue. It's been too long since I've been using AHK to recall if the first four lines might have any relevant effect.

However, I fixed the crash when selecting the start menu. It seems that the buffer used to grab process name and window title wasn't long enough in that case, which is odd because it should just be C:\WINDOWS\explorer.exe, far less than the 256 chars I allotted for in the buffer. Regardless, doubling that to 512 in ad1b394 did the trick on my end, and I've uploaded a new release with the fix.

@Zerogaku
Copy link
Author

Zerogaku commented May 7, 2024

Hey thanks, after installing the new version opening the windows start menu with the mouse no longer crashes it.
As for it crashing when autostarting with autohotkey, the problem was because of quotation marks around the --config-file parameter .
This was the problem line:

Run("C:\Users\Null\.config\kanata\kanata_helper_daemon.exe --port=1337 --config-file='C:\Users\Null\.config\kanata\config.kbd' --default-layer=default", , "Hide")

this is the working line:

Run "C:\Users\Null\.config\kanata\kanata_helper_daemon.exe -p 1337 --config-file=C:\Users\Null\.config\kanata\config.kbd --default-layer=default",, "Hide"

Thanks for the help!

@Zerogaku Zerogaku closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants