fix: Command:output() should set stderr to piped instead of stdin (#3458)

This commit is contained in:
三咲雅 misaki masa 2025-12-24 16:18:11 +08:00 committed by GitHub
parent 8c81172a19
commit 2f66561a82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 3 deletions

View file

@ -3,7 +3,7 @@ local M = {}
function M:peek(job)
local cmd = os.getenv("YAZI_FILE_ONE") or "file"
local path = tostring(job.file.cache or job.file.url)
local output, err = Command(cmd):arg({ "-bL", "--", path }):stdout(Command.PIPED):output()
local output, err = Command(cmd):arg({ "-bL", "--", path }):output()
local text
if output then

View file

@ -42,7 +42,6 @@ function M:preload(job)
"-jpeg", "-jpegopt", "quality=" .. rt.preview.image_quality,
tostring(job.file.url), tostring(cache),
})
:stderr(Command.PIPED)
:output()
if not output then

View file

@ -97,8 +97,8 @@ impl Command {
}
async fn output(&mut self) -> io::Result<std::process::Output> {
self.inner.stdin(Stdio::piped());
self.inner.stdout(Stdio::piped());
self.inner.stderr(Stdio::piped());
self.spawn()?.wait_with_output().await
}