diff options
author | Canop <cano.petrole@gmail.com> | 2020-08-01 09:02:48 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-08-01 09:02:48 +0200 |
commit | b30e8affeb866e72581e92152e0f94e55cac6793 (patch) | |
tree | cc338f6cb7933f6daea3cc7d628a51b852555790 /src/browser/browser_state.rs | |
parent | 97702caaf56b36fb7a479bd371815d1e7c289d9c (diff) |
make the selected directory the working dir of subprocesses
It's especially interesting when you launch a terminal from broot.
Diffstat (limited to 'src/browser/browser_state.rs')
-rw-r--r-- | src/browser/browser_state.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs index 15539d0..802f039 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -215,6 +215,7 @@ fn make_opener( con: &AppContext, ) -> Result<AppStateCmdResult, ProgramError> { Ok(if is_exe { + let working_dir = path::closest_dir(&path); let path = path.to_string_lossy().to_string(); if let Some(export_path) = &con.launch_args.cmd_export_path { // broot was launched as br, we can launch the executable from the shell @@ -222,7 +223,7 @@ fn make_opener( writeln!(&f, "{}", path)?; AppStateCmdResult::Quit } else { - AppStateCmdResult::from(Launchable::program(vec![path])?) + AppStateCmdResult::from(Launchable::program(vec![path], working_dir)?) } } else { AppStateCmdResult::from(Launchable::opener(path)) |