aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/setup.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-10-17 19:39:37 +0200
committerGitHub <noreply@github.com>2022-10-17 19:39:37 +0200
commit271abb3ea2842cadc131ae91a3cd899e320e958e (patch)
treeb20d4231f6d5b46737efe6b60b4e4e0170a87640 /zellij-utils/src/setup.rs
parentchangelog: Add PR #1800 (diff)
downloadsl0ppij-271abb3ea2842cadc131ae91a3cd899e320e958e.tar.gz
sl0ppij-271abb3ea2842cadc131ae91a3cd899e320e958e.tar.xz
sl0ppij-271abb3ea2842cadc131ae91a3cd899e320e958e.zip
feat(cli): zellij run improvements (#1804)
* feat(cli): move command to the end of the cli arguments * feat(cli): allow naming panes from the command line * fix(cli): adjust actions after pane rename * feat(cli): zellij run completions for fish * feat(cli): zellij run completions for bash and zsh * style(fmt): rustfmt * fix(e2e): fix run test and snapshot * style(fmt): rustfmt
Diffstat (limited to 'zellij-utils/src/setup.rs')
-rw-r--r--zellij-utils/src/setup.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/zellij-utils/src/setup.rs b/zellij-utils/src/setup.rs
index 9972915e..c105c929 100644
--- a/zellij-utils/src/setup.rs
+++ b/zellij-utils/src/setup.rs
@@ -125,6 +125,18 @@ pub const FISH_EXTRA_COMPLETION: &[u8] = include_bytes!(concat!(
"assets/completions/comp.fish"
));
+pub const BASH_EXTRA_COMPLETION: &[u8] = include_bytes!(concat!(
+ env!("CARGO_MANIFEST_DIR"),
+ "/",
+ "assets/completions/comp.bash"
+));
+
+pub const ZSH_EXTRA_COMPLETION: &[u8] = include_bytes!(concat!(
+ env!("CARGO_MANIFEST_DIR"),
+ "/",
+ "assets/completions/comp.zsh"
+));
+
pub const BASH_AUTO_START_SCRIPT: &[u8] = include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/",
@@ -412,13 +424,17 @@ impl Setup {
clap_complete::generate(shell, &mut CliArgs::command(), "zellij", &mut out);
// add shell dependent extra completion
match shell {
- Shell::Bash => {},
+ Shell::Bash => {
+ let _ = out.write_all(BASH_EXTRA_COMPLETION);
+ },
Shell::Elvish => {},
Shell::Fish => {
let _ = out.write_all(FISH_EXTRA_COMPLETION);
},
Shell::PowerShell => {},
- Shell::Zsh => {},
+ Shell::Zsh => {
+ let _ = out.write_all(ZSH_EXTRA_COMPLETION);
+ },
_ => {},
};
}