fix: don't follow the symbolic on Linux (#77)

This commit is contained in:
三咲雅 · Misaki Masa 2023-08-20 21:44:39 +08:00 committed by GitHub
parent 4f52d829bb
commit c051df3f60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ rules = [
{ mime = "application/x-bzip2", use = "archive" },
{ mime = "application/x-tar", use = "archive" },
{ mime = "application/x-7z-compressed", use = "archive" },
{ mime = "application/x-rar",use = "archive" },
{ mime = "application/x-rar", use = "archive" },
{ mime = "*", use = "fallback" },
]

View File

@ -27,7 +27,7 @@ impl Default for PreviewAdaptor {
}
match env::var("TERM_PROGRAM").unwrap_or_default().as_str() {
"iTerm.app" => return Self::Iterm2,
"WezTerm" => return if cfg!(windows) { Self::Iterm2 } else { Self::Kitty },
"WezTerm" => return cfg!(windows).then_some(Self::Iterm2).unwrap_or(Self::Kitty),
"vscode" => return Self::Sixel,
"Hyper" => return Self::Sixel,
_ => {}

View File

@ -10,7 +10,7 @@ pub async fn file(files: &[impl AsRef<OsStr>]) -> Result<BTreeMap<PathBuf, Strin
}
let output = Command::new("file")
.args(["-b", "--mime-type"])
.args([cfg!(windows).then_some("-b").unwrap_or("-bL"), "--mime-type"])
.args(files)
.kill_on_drop(true)
.output()