on master help sign in
respond to SIGUSR1 by reloading config (#3952)
9124c23Karsten Gebbert
book/src/configuration.md+4
@@ -28,6 +28,10 @@ hidden = false
28You may also specify a file to use for configuration with the `-c` or
28You may also specify a file to use for configuration with the `-c` or
29`--config` CLI argument: `hx -c path/to/custom-config.toml`.
29`--config` CLI argument: `hx -c path/to/custom-config.toml`.
30
30
31+It is also possible to trigger configuration file reloading by sending the `USR1`
32+signal to the helix process, e.g. via `pkill -USR1 hx`. This is only supported
33+on unix operating systems.
34+
31## Editor
35## Editor
32
36
33### `[editor]` Section
37### `[editor]` Section
helix-term/src/application.rs+6−2
@@ -224,8 +224,8 @@ impl Application {
224 #[cfg(windows)]
224 #[cfg(windows)]
225 let signals = futures_util::stream::empty();
225 let signals = futures_util::stream::empty();
226 #[cfg(not(windows))]
226 #[cfg(not(windows))]
227− let signals =
228− Signals::new(&[signal::SIGTSTP, signal::SIGCONT]).context("build signal handler")?;
227+ let signals = Signals::new(&[signal::SIGTSTP, signal::SIGCONT, signal::SIGUSR1])
228+ .context("build signal handler")?;
229
229
230 let app = Self {
230 let app = Self {
231 compositor,
231 compositor,
@@ -426,6 +426,10 @@ impl Application {
426 self.compositor.load_cursor();
426 self.compositor.load_cursor();
427 self.render();
427 self.render();
428 }
428 }
429+ signal::SIGUSR1 => {
430+ self.refresh_config();
431+ self.render();
432+ }
429 _ => unreachable!(),
433 _ => unreachable!(),
430 }
434 }
431 }
435 }