mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-12-29 04:23:01 +00:00
Fix illegal option in fzf preview window (#460)
Co-authored-by: zhuchunyan <zhuchunyuan@gaodun.com> Co-authored-by: Ajeet D'Souza <98ajeet@gmail.com>
This commit is contained in:
parent
0f3ae894f1
commit
c137019b83
12
src/util.rs
12
src/util.rs
@ -53,16 +53,12 @@ impl Fzf {
|
|||||||
]);
|
]);
|
||||||
if cfg!(unix) {
|
if cfg!(unix) {
|
||||||
// Non-POSIX args are only available on certain operating systems.
|
// Non-POSIX args are only available on certain operating systems.
|
||||||
const LS_ARGS: &str = if cfg!(target_os = "linux") {
|
const PREVIEW_CMD: &str = if cfg!(target_os = "linux") {
|
||||||
"--color=always --group-directories-first"
|
r"\command -p ls -Cp --color=always --group-directories-first {2..}"
|
||||||
} else if cfg!(target_os = "macos") {
|
|
||||||
"--color=always"
|
|
||||||
} else {
|
} else {
|
||||||
""
|
r"\command -p ls -Cp {2..}"
|
||||||
};
|
};
|
||||||
command
|
command.args(&["--preview", PREVIEW_CMD, "--preview-window=down,30%"]).env("SHELL", "sh");
|
||||||
.args(&[&format!(r"--preview=\command -p ls -Cp {LS_ARGS} {{2..}}"), "--preview-window=down,30%"])
|
|
||||||
.env("SHELL", "sh");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user