Skip to content

Commit 2b6fb06

Browse files
committed
fix(media): ueberzug on MacOS (#1671)
1 parent dad63e2 commit 2b6fb06

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lua/fzf-lua/previewer/builtin.lua

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,12 +564,15 @@ end
564564

565565
function Previewer.buffer_or_file:start_ueberzug()
566566
if self._ueberzug_fifo then return self._ueberzug_fifo end
567-
local fifo = ("fzf-lua-%d-ueberzug"):format(vim.fn.getpid())
568-
self._ueberzug_fifo = utils.io_systemlist({ "mktemp", "--dry-run", "--suffix", fifo })[1]
567+
self._ueberzug_fifo = path.join({
568+
vim.fn.fnamemodify(vim.fn.tempname(), ":h"),
569+
string.format("fzf-lua-%d-ueberzug", vim.fn.getpid())
570+
})
569571
utils.io_system({ "mkfifo", self._ueberzug_fifo })
570572
self._ueberzug_job = vim.fn.jobstart({ "sh", "-c",
571-
("tail --follow %s | ueberzug layer --parser json")
572-
:format(libuv.shellescape(self._ueberzug_fifo))
573+
string.format(
574+
"tail -f %s | ueberzug layer --parser json",
575+
libuv.shellescape(self._ueberzug_fifo))
573576
}, {
574577
on_exit = function(_, rc, _)
575578
if rc ~= 0 and rc ~= 143 then

0 commit comments

Comments
 (0)