Skip to content

Commit 8bc7a3a

Browse files
fix: process bug when running show commands on Windows (#330)
1 parent b11f305 commit 8bc7a3a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/ops/show.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ fn editor(file: &Path, maybe_line: Option<u32>) -> Option<Action> {
8787

8888
fn parse_editor_command(editor: &str, file: &str, maybe_line: Option<u32>) -> Command {
8989
let args = &editor.split_whitespace().collect::<Vec<_>>();
90+
#[cfg(windows)]
91+
let mut cmd = {
92+
let mut c = Command::new("cmd");
93+
c.arg("/C");
94+
c.arg(args[0]);
95+
c
96+
};
97+
98+
#[cfg(not(windows))]
9099
let mut cmd = Command::new(args[0]);
91100
cmd.args(&args[1..]);
92101

0 commit comments

Comments
 (0)