mirror of
https://github.com/zellij-org/zellij.git
synced 2026-09-21 16:02:34 +00:00
Fish completion delete session (#5317)
* Add session completion for "delete-session" Close #5316 * Force default value for CARGO_TARGET_DIR Since we did not approved and maintain #2611 * Move `xtask run`'s specific output to stderr That way command output can be redirected without garbage e.g.: `cargo xtask run -- setup --generate-completion fish > ~/.config/fish/completions/zellij.fish` --------- Co-authored-by: Zykino <3809938+Zykino@users.noreply.github.com>
This commit is contained in:
@@ -8,3 +8,6 @@ make = "xtask deprecated"
|
||||
|
||||
[target.x86_64-pc-windows-gnu]
|
||||
linker = "x86_64-w64-mingw32-gcc"
|
||||
|
||||
[build]
|
||||
target-dir = "target"
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ cargo xtask build
|
||||
cargo xtask test
|
||||
# Run Zellij (optionally with additional arguments)
|
||||
cargo xtask run
|
||||
cargo xtask run -l strider
|
||||
cargo xtask run -- -l strider
|
||||
# Run Clippy
|
||||
cargo xtask clippy
|
||||
# Install Zellij to some directory
|
||||
|
||||
+2
-2
@@ -38,10 +38,10 @@ pub fn build(sh: &Shell, flags: flags::Build) -> anyhow::Result<()> {
|
||||
.collect();
|
||||
|
||||
if !plugin_members.is_empty() {
|
||||
println!();
|
||||
eprintln!();
|
||||
let msg = ">> Building plugins";
|
||||
crate::status(msg);
|
||||
println!("{}", msg);
|
||||
eprintln!("{}", msg);
|
||||
|
||||
let mut base_cmd = cmd!(sh, "{cargo} build --target wasm32-wasip1");
|
||||
if flags.release {
|
||||
|
||||
+2
-2
@@ -146,7 +146,7 @@ fn main() -> anyhow::Result<()> {
|
||||
|
||||
let elapsed = now.elapsed().as_secs();
|
||||
status(&format!("xtask (done after {} s)", elapsed));
|
||||
println!("\n\n>> Command took {} s", elapsed);
|
||||
eprintln!("\n\n>> Command took {} s", elapsed);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ pub fn cargo() -> anyhow::Result<PathBuf> {
|
||||
|
||||
// Set terminal title to 'msg'
|
||||
pub fn status(msg: &str) {
|
||||
print!("\u{1b}]0;{}\u{07}", msg);
|
||||
eprint!("\u{1b}]0;{}\u{07}", msg);
|
||||
}
|
||||
|
||||
fn deprecation_notice() -> anyhow::Result<()> {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
function __fish_complete_sessions
|
||||
zellij list-sessions --short --no-formatting 2>/dev/null
|
||||
end
|
||||
complete -c zellij -n "__fish_seen_subcommand_from attach" -f -a "(__fish_complete_sessions)" -d "Session"
|
||||
complete -c zellij -n "__fish_seen_subcommand_from a" -f -a "(__fish_complete_sessions)" -d "Session"
|
||||
complete -c zellij -n "__fish_seen_subcommand_from kill-session" -f -a "(__fish_complete_sessions)" -d "Session"
|
||||
complete -c zellij -n "__fish_seen_subcommand_from k" -f -a "(__fish_complete_sessions)" -d "Session"
|
||||
complete -c zellij -n "__fish_seen_subcommand_from setup" -l "generate-completion" -x -a "bash elvish fish zsh powershell" -d "Shell"
|
||||
complete -c zellij -n "__fish_seen_subcommand_from attach" -f -a "(__fish_complete_sessions)" -d Session
|
||||
complete -c zellij -n "__fish_seen_subcommand_from a" -f -a "(__fish_complete_sessions)" -d Session
|
||||
complete -c zellij -n "__fish_seen_subcommand_from kill-session" -f -a "(__fish_complete_sessions)" -d Session
|
||||
complete -c zellij -n "__fish_seen_subcommand_from k" -f -a "(__fish_complete_sessions)" -d Session
|
||||
complete -c zellij -n "__fish_seen_subcommand_from delete-session" -f -a "(__fish_complete_sessions)" -d Session
|
||||
complete -c zellij -n "__fish_seen_subcommand_from d" -f -a "(__fish_complete_sessions)" -d Session
|
||||
complete -c zellij -n "__fish_seen_subcommand_from setup" -l generate-completion -x -a "bash elvish fish zsh powershell" -d Shell
|
||||
function zr
|
||||
command zellij run --name "$argv" -- fish -c "$argv"
|
||||
end
|
||||
@@ -36,4 +38,4 @@ function zpipe
|
||||
command zellij pipe
|
||||
end
|
||||
end
|
||||
complete -c zpipe -f -a "(__fish_complete_aliases)" -d "Zpipes"
|
||||
complete -c zpipe -f -a "(__fish_complete_aliases)" -d Zpipes
|
||||
|
||||
Reference in New Issue
Block a user