Tried to update to powershell

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>
This commit is contained in:
alexis-opolka 2024-12-08 13:37:44 +01:00
parent 31b831317a
commit 0c6684a921
2 changed files with 10 additions and 1 deletions

View file

@ -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,

View file

@ -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}");