mirror of https://github.com/helix-editor/helix
respond to SIGUSR1 by reloading config (#3952)
* respond to SIGUSR1 by reloading config * document USR1 signal handlingpull/4085/head
parent
3d59d3f8be
commit
9124c231f4
|
@ -28,6 +28,10 @@ hidden = false
|
||||||
You may also specify a file to use for configuration with the `-c` or
|
You may also specify a file to use for configuration with the `-c` or
|
||||||
`--config` CLI argument: `hx -c path/to/custom-config.toml`.
|
`--config` CLI argument: `hx -c path/to/custom-config.toml`.
|
||||||
|
|
||||||
|
It is also possible to trigger configuration file reloading by sending the `USR1`
|
||||||
|
signal to the helix process, e.g. via `pkill -USR1 hx`. This is only supported
|
||||||
|
on unix operating systems.
|
||||||
|
|
||||||
## Editor
|
## Editor
|
||||||
|
|
||||||
### `[editor]` Section
|
### `[editor]` Section
|
||||||
|
|
|
@ -224,8 +224,8 @@ impl Application {
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
let signals = futures_util::stream::empty();
|
let signals = futures_util::stream::empty();
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
let signals =
|
let signals = Signals::new(&[signal::SIGTSTP, signal::SIGCONT, signal::SIGUSR1])
|
||||||
Signals::new(&[signal::SIGTSTP, signal::SIGCONT]).context("build signal handler")?;
|
.context("build signal handler")?;
|
||||||
|
|
||||||
let app = Self {
|
let app = Self {
|
||||||
compositor,
|
compositor,
|
||||||
|
@ -426,6 +426,10 @@ impl Application {
|
||||||
self.compositor.load_cursor();
|
self.compositor.load_cursor();
|
||||||
self.render();
|
self.render();
|
||||||
}
|
}
|
||||||
|
signal::SIGUSR1 => {
|
||||||
|
self.refresh_config();
|
||||||
|
self.render();
|
||||||
|
}
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue