diff options
author | Tw <wei.tan@intel.com> | 2021-09-09 18:45:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-09 11:45:03 +0100 |
commit | 19b3f8366f7a46ac9360bd17b670c240d0aabe87 (patch) | |
tree | 851724437bfe9bb56cfec379f509f1047a3f5c0f /zellij-tile/src | |
parent | 6d0c5a56f54eb3f47991cc2743587103cffc123c (diff) |
feat(plugin): add exec_cmd helper for executing command in host
Signed-off-by: Tw <wei.tan@intel.com>
Signed-off-by: Tw <tw19881113@gmail.com>
Diffstat (limited to 'zellij-tile/src')
-rw-r--r-- | zellij-tile/src/shim.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/zellij-tile/src/shim.rs b/zellij-tile/src/shim.rs index b514b55aa..bdd6f4fb1 100644 --- a/zellij-tile/src/shim.rs +++ b/zellij-tile/src/shim.rs @@ -37,6 +37,10 @@ pub fn open_file(path: &Path) { pub fn set_timeout(secs: f64) { unsafe { host_set_timeout(secs) }; } +pub fn exec_cmd(cmd: &[&str]) { + object_to_stdout(&cmd); + unsafe { host_exec_cmd() }; +} // Internal Functions @@ -60,4 +64,5 @@ extern "C" { fn host_get_plugin_ids(); fn host_open_file(); fn host_set_timeout(secs: f64); + fn host_exec_cmd(); } |