Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The preview format used on Windows is only for "cmd.exe". #896

Open
UnderCooled opened this issue May 8, 2024 · 1 comment
Open

The preview format used on Windows is only for "cmd.exe". #896

UnderCooled opened this issue May 8, 2024 · 1 comment

Comments

@UnderCooled
Copy link

diff --git a/src/commands/core/actor.rs b/src/commands/core/actor.rs
index 91a1846..ae3d413 100644
--- a/src/commands/core/actor.rs
+++ b/src/commands/core/actor.rs
@@ -63,7 +63,7 @@ fn prompt_finder(
 
     let exe = fs::exe_string();
 
-    let preview = if cfg!(target_os = "windows") {
+    let preview = if CONFIG.shell().contains("cmd.exe") {
         format!(
             r#"(@echo.{{+}}{eof}{{q}}{eof}{name}{eof}{extra}) | {exe} preview-var-stdin"#,
             exe = exe,

So after this modification, FZF preview will use the right way to communicate with other shells.
I set config.yaml shell command to elvish or nushell, they work OK with the default preview format.

Pwsh will still show an error, so it needs another preview format, but it is too slow to be used as a preview shell anyway.

Copy link

welcome bot commented May 8, 2024

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant