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

Please add sig(term) signal handler #19

Open
igalic opened this issue Jan 14, 2019 · 1 comment
Open

Please add sig(term) signal handler #19

igalic opened this issue Jan 14, 2019 · 1 comment

Comments

@igalic
Copy link

igalic commented Jan 14, 2019

As a continuation of #9, i would like to see a SIGTERM handler so that a regular shutdown/reboot of my laptop will actually save my work


n.b.: I've tried to add this myself, but… as I'm only very newly acquainted with Rust, i felt very much out of my waters, especially, since this app doesn't already have any signal handlers, and rust itself has no… standard signal handlers see rust-lang/rfcs#1368 vs https://crates.io/search?q=signal

@igalic
Copy link
Author

igalic commented Apr 5, 2019

looking at,

void/src/config.rs

Lines 124 to 135 in 7cdbab0

#[derive(Debug, Clone)]
pub struct Config {
config: HashMap<Key, Action>,
}
impl Default for Config {
fn default() -> Config {
use termion::event::Key::*;
Config {
config: vec![
(Esc, Action::UnselectRet),
(PageUp, Action::ScrollUp),

i am imagining an equivalent of HashMap<Signal, Action>


This is as far as i've gotten: https://gist.github.com/igalic/7773dbc93c45daf0bfb259b48ba1486c#file-signal-diff

the next step would be to modify screen.run() to not just handle_events() but also handle_signals()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants