|
1 | 1 | use std::fs; |
2 | 2 | use std::path::{Path, PathBuf}; |
| 3 | +use std::process::Command; |
3 | 4 |
|
4 | 5 | use jsonc_parser::ParseOptions; |
5 | 6 | use jsonc_parser::cst::{CstInputValue, CstRootNode}; |
@@ -84,12 +85,23 @@ impl Target { |
84 | 85 | let updated = self.apply_theme(&original, theme)?; |
85 | 86 | let changed = write_target(&path, *self, &original, &updated, dry_run)?; |
86 | 87 |
|
87 | | - // SIGUSR2 to reload ghostty config |
88 | | - // refer to https://github.com/ghostty-org/ghostty/issues/7747 |
89 | | - if changed && !dry_run && matches!(self, Self::Ghostty) { |
90 | | - let _ = std::process::Command::new("killall") |
91 | | - .args(["-USR2", "ghostty"]) |
92 | | - .status(); |
| 88 | + if changed && !dry_run { |
| 89 | + match self { |
| 90 | + // SIGUSR2 to reload ghostty config. |
| 91 | + // Refer to https://github.com/ghostty-org/ghostty/issues/7747. |
| 92 | + Self::Ghostty => { |
| 93 | + let _ = Command::new("pkill") |
| 94 | + .args(["-USR2", "-x", "ghostty"]) |
| 95 | + .status(); |
| 96 | + } |
| 97 | + // SIGUSR1 to reload helix config |
| 98 | + // Refer to https://github.com/helix-editor/helix/issues/2158#issuecomment-1910775800 |
| 99 | + Self::Helix => { |
| 100 | + let _ = Command::new("pkill").args(["-USR1", "-x", "hx"]).status(); |
| 101 | + } |
| 102 | + // Zed hot reloads |
| 103 | + Self::Zed => {} |
| 104 | + } |
93 | 105 | } |
94 | 106 |
|
95 | 107 | Ok(true) |
|
0 commit comments