diff options
| author | Aram Drevekenin <aram@poor.dev> | 2023-10-16 13:42:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-16 13:42:19 +0200 |
| commit | d2b6fb5c5b0423143d71218196a56ea3e395cd47 (patch) | |
| tree | b913e91850c9eb98f554aec2dfc94cbe9b11bca6 /default-plugins/fixture-plugin-for-tests | |
| parent | fix(plugins): make new auxiliary functions public (#2765) (diff) | |
| download | sl0ppij-d2b6fb5c5b0423143d71218196a56ea3e395cd47.tar.gz sl0ppij-d2b6fb5c5b0423143d71218196a56ea3e395cd47.tar.xz sl0ppij-d2b6fb5c5b0423143d71218196a56ea3e395cd47.zip | |
feat(plugins): plugin run_command api (#2862)
* prototype
* add tests
* style(fmt): rustfmt
* update comments
* deprecation warning for execcmd
Diffstat (limited to 'default-plugins/fixture-plugin-for-tests')
| -rw-r--r-- | default-plugins/fixture-plugin-for-tests/src/main.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/default-plugins/fixture-plugin-for-tests/src/main.rs b/default-plugins/fixture-plugin-for-tests/src/main.rs index 811a4507..cdbdc9f2 100644 --- a/default-plugins/fixture-plugin-for-tests/src/main.rs +++ b/default-plugins/fixture-plugin-for-tests/src/main.rs @@ -240,6 +240,23 @@ impl ZellijPlugin for State { Key::Ctrl('1') => { request_permission(&[PermissionType::ReadApplicationState]); }, + Key::Ctrl('2') => { + let mut context = BTreeMap::new(); + context.insert("user_key_1".to_owned(), "user_value_1".to_owned()); + run_command(&["ls", "-l"], context); + }, + Key::Ctrl('3') => { + let mut context = BTreeMap::new(); + context.insert("user_key_2".to_owned(), "user_value_2".to_owned()); + let mut env_vars = BTreeMap::new(); + env_vars.insert("VAR1".to_owned(), "some_value".to_owned()); + run_command_with_env_variables_and_cwd( + &["ls", "-l"], + env_vars, + std::path::PathBuf::from("/some/custom/folder"), + context, + ); + }, _ => {}, }, Event::CustomMessage(message, payload) => { |
