From 0c6684a921cdddc28f22bdfab3f0fac628f5d674 Mon Sep 17 00:00:00 2001 From: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com> Date: Sun, 8 Dec 2024 13:37:44 +0100 Subject: [PATCH] Tried to update to powershell Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com> --- src/commands/core/actor.rs | 9 ++++++++- src/commands/shell.rs | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/commands/core/actor.rs b/src/commands/core/actor.rs index ae3d413..df6500c 100644 --- a/src/commands/core/actor.rs +++ b/src/commands/core/actor.rs @@ -63,7 +63,14 @@ fn prompt_finder( let exe = fs::exe_string(); - let preview = if CONFIG.shell().contains("cmd.exe") { + let preview = if CONFIG.shell().contains("powershell.exe"){ + format!( + r#"({{+}}@'{{q}}'@@'{name}'@{extra}) | {exe} preview-var-stdin"#, + exe = exe, + name = variable_name, + extra = extra_preview.clone().unwrap_or_default(), + ) + } else if CONFIG.shell().contains("cmd.exe") { format!( r#"(@echo.{{+}}{eof}{{q}}{eof}{name}{eof}{extra}) | {exe} preview-var-stdin"#, exe = exe, diff --git a/src/commands/shell.rs b/src/commands/shell.rs index 9b01272..63e2ead 100644 --- a/src/commands/shell.rs +++ b/src/commands/shell.rs @@ -14,6 +14,7 @@ impl Display for Shell { Self::Fish => "fish", Self::Elvish => "elvish", Self::Nushell => "nushell", + Self::PowerShell => "powershell" }; write!(f, "{s}") @@ -36,6 +37,7 @@ impl Runnable for Input { Shell::Fish => include_str!("../../shell/navi.plugin.fish"), Shell::Elvish => include_str!("../../shell/navi.plugin.elv"), Shell::Nushell => include_str!("../../shell/navi.plugin.nu"), + Shell::PowerShell => include_str!("../../shell/navi.plugin.ps1"), }; println!("{content}");