Comments (6)
/dev/input/eventxx device is deleted when kanata exits. Not sure why though.
I would guess this is properly cleaned up and closed because the kernel knows about the kanata process and the fact that it has files related to the evdev interface open. So it's the kernel cleaning up as opposed to Rust code. This is in contrast to the symlink which is a filesystem concept independent of the input devices, so the kernel doesn't care to clean it up, and if the Rust code Drop
handlers don't get called, it won't be cleaned up.
systemd by default use SIGTERM and SIGKILL to terminate a process which ctrlc cannot handle
The ctrlc does handle SIGTERM
according to the documentation. Also, no crate gives the power to handle SIGKILL
because the kernel never passes that signal onto the process; it just ends the process immediately. Just providing some clarification; the signal-hook
crate is a fine choice as well.
from kanata.
Sure, could you say more about what about kanata's exit is not graceful? Would it need to catch an unwind and do some evdev cleanup before fully exiting?
from kanata.
Here is my WIP commit: jian-lin/kanata@c9427c9
The problem is symlink is not deleted after I Ctrl-C kanata.
Steps to reproduce:
- sudo ./target/debug/kanata --cfg cfg_samples/custom.kbd --symlink-name kanata
- type
Ctrl-C
after it starts /dev/input/by-id/kanata
is a broken symlink, which ideally should be deleted
from kanata.
Right, the issue you've run into is that Rust does not guarantee that Drop
implementations will be called for your code, which isn't specific to kanata. You'll need to add custom signal handlers for cleanup.
https://lib.rs/crates/ctrlc might be of help
from kanata.
Would it need to catch an unwind and do some evdev cleanup before fully exiting
/dev/input/eventxx
device is deleted when kanata exits. Not sure why though.
You'll need to add custom signal handlers for cleanup. https://lib.rs/crates/ctrlc might be of help
Yeah, handling signals is a solution.
However I prefer signal-hook because:
- the symlink feature is linux-specific so
ctrls
's cross-platform ability is not needed - systemd by default use
SIGTERM
andSIGKILL
to terminate a process whichctrlc
cannot handle
from kanata.
I don't think there's any issue in the repository that needs to be fixed, is that correct? Closing this issue, but feel free to re-open if I'm mistaken.
from kanata.
Related Issues (20)
- Bug: Release 1.6.1 macos_x86_64 executable isn't what it says. HOT 6
- Feature request: Show keystroke or can let other app know the real key is stroked. HOT 2
- Feature request: Can we have a more flexible unmod? HOT 1
- See if windows shift workaround can be compiled out for winiov2 HOT 1
- Bug: kanata does not work properly with listary HOT 3
- `release-key` releases both sides of a mod and not just one, e.g. `lctl` and `rctl` or `lmet` and `rmet` HOT 7
- Feature request: Compile-time conditional mappings HOT 1
- chordsv2 activation does not trigger early interruption of `tap-hold-press|release` HOT 9
- make macro-release-cancel also cancel virtual keys HOT 1
- Bug: switch's layer logic not recognized HOT 2
- Feature request: remove dependency on AutohotKey for EnableUIAccess
- Feature request: configurable declared bus type for Linux uinput HOT 9
- unable to set linux-use-trackpoint-propety HOT 3
- one-shot shift interferes with defoverrides HOT 5
- Feature request: chord toggle action HOT 1
- Feature request: homebrew HOT 2
- Bug: special buttons on function row not working on macos HOT 2
- Bug: chord v2 overlapping chords HOT 2
- Bug: tray icons change randomly when layer changes by Meta key.
- Bug: S-home does not work as expected HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kanata.