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)
- Feature request: intercept all mice in Wintercept build HOT 1
- defoverrides is ignored in unmod and unshift HOT 2
- Directional Keys Not Working in Windows Task View HOT 6
- Bug: Home row mods advanced issue with block-unmapped-keys HOT 3
- Bug: unable to globally swap caps and esc HOT 2
- Feature request: modular per-platform config.adoc HOT 9
- Feature request: togglable `caps-word` HOT 2
- Bug: In WSL space is inserted after shift or control when running kanata in host HOT 1
- Bug: windows iconbar icon isn't removed when app is killed HOT 1
- Bug: Dead keys cause keyboard modifier state to get corrupt - witnessed on colemak HOT 7
- Feature request: support platform-specific IPC which has greater convenience than TCP
- Feature request: Auto Mouse Keys layer HOT 2
- Feature request: support BSD HOT 5
- Unable to send key input due to key having not been physically released yet. HOT 3
- 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
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.