mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
fix: Command:output() should set stderr to piped instead of stdin (#3458)
This commit is contained in:
parent
8c81172a19
commit
2f66561a82
3 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue