diff options
Diffstat (limited to 'src/platform/linux.rs')
| -rw-r--r-- | src/platform/linux.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 4e5574d0..be0c97b9 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -39,6 +39,23 @@ static FOREGROUND_MEMBERS_CACHE: Mutex<ForegroundMembersCache> = pub fn raise_server_nofile_limit() {} +fn raw_command_argv(command: &str, flag: &str) -> Vec<std::ffi::OsString> { + vec!["/bin/sh".into(), flag.into(), command.into()] +} + +pub(crate) fn detached_custom_command_process_platform(command: &str) -> std::process::Command { + let argv = raw_command_argv(command, "-lc"); + let mut command = std::process::Command::new(&argv[0]); + command.args(&argv[1..]); + command +} + +pub(crate) fn pane_custom_command_pty_builder_platform( + command: &str, +) -> portable_pty::CommandBuilder { + portable_pty::CommandBuilder::from_argv(raw_command_argv(command, "-c")) +} + pub(crate) fn scrollback_editor_argv(path: &std::path::Path) -> std::io::Result<Vec<String>> { let quoted_path = shell_quote(&path.display().to_string()); let command = format!( |
