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

starting with a faulty configuration file does not stop execution #114

Closed
kbilsted opened this issue Mar 15, 2024 · 7 comments
Closed

starting with a faulty configuration file does not stop execution #114

kbilsted opened this issue Mar 15, 2024 · 7 comments

Comments

@kbilsted
Copy link
Contributor

kbilsted commented Mar 15, 2024

When making an error in the configuration file and running I get

PS C:\keymapper-3.5.3-win64> .\keymapper.exe
ERROR: Missing '>>' in line 1

which is fine. When I fix my error and save the file rerun i get

PS C:\keymapper-3.5.3-win64> .\keymapper.exe
ERROR: Another instance is already running 

why is keymapper not stopping on error?

When I then run

.\keymapper.exe --update

I still get ERROR: Another instance is already running

@ristomatti
Copy link
Contributor

Are you sure you didn't have a previous instance with --update already running? With --update keymapper monitors changes on the config file and updates the changes on the fly. If there's an error, the previous config will stay active. But if no keymapper process is running, it won't start at all if there's an error.

At least this is how it behaves on Linux, I can't be sure if it's the same on Windows.

@kbilsted
Copy link
Contributor Author

Yes it was running. Perhaps I'm confusing keymapper and keymapperd - but should i run when the configuration is illegal?

@houmain
Copy link
Owner

houmain commented Mar 16, 2024

Hi, this is actually a feature of the Windows version, which has the tray icon to easily open the configuration and correct it. It even keeps running without a configuration.
But I will change it to conditionally enable this feature, depending on whether the configuration is automatically reloaded or not. So if you start keymapper without any arguments and the configuration is faulty it will exit after reporting the error.
This will be available in the upcoming 4.0.0 release.

@kbilsted
Copy link
Contributor Author

@houmain Thanks for the quick reply.

I was merely surprised about the behavior.. I've started using it with -u

I think a more important feature would be to notify the user when the configuration is faulty. Ie. when starting it from outside a console, then there is no feedback in error situations. Again this is mostly for newcommers trying it out and having problems initially. Perhaps the tray utility could pop open a ok-window telling that there are errors at line x

@houmain
Copy link
Owner

houmain commented Mar 17, 2024

It should show a notification containing the error message. I have only tested it on Windows 10. Are you using Windows 11?

@kbilsted
Copy link
Contributor Author

Im on win 11 and im happy to test for you. I think it is a combination of many things. Yesterday I got notifications. I dont today. I can see I configured the notifications a LOOONG time a go and never thought of it again as I generally dont like all those messages. I've desperately gone through the settings fighting it on not turning off notifications in office hours. It has finally come OFF DonotDisturb.. but i dont see messages as i did last night. Perhaps it wants me to reboot for the settings to really kick in, but im not in the mood for that right now.

Perhaps im old school but loading an illegal config should be rare once things are configured so Id prefer a normal OK window over some notification that can be muted. More over.. when encountering illegal config, you are not aware of it and your keyboard just behaves "odd".

@kbilsted
Copy link
Contributor Author

ok I get the notifications now. I reran the keymapper.exe - it told me another instance is running but it changed the somthing as the notifications are back. Man, im not friends with windows notifications 👍🏻

@houmain houmain closed this as completed Mar 28, 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

3 participants