Skip to content

Commit 3f3f462

Browse files
authored
Merge pull request #16 from jtonic/main
fix: string escape for absolute path
2 parents 8de9500 + 831b534 commit 3f3f462

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lua/image_preview/init.lua

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,13 @@ function M.PreviewImage(absolutePath)
4646
.. "'" .. absolutePath .. "'"
4747
.. " ; pause"
4848
else
49-
command = "silent !wezterm cli split-pane -- bash -c 'wezterm imgcat "
50-
.. absolutePath
51-
.. " ; read'"
49+
command = "silent !wezterm cli split-pane -- bash -c 'wezterm imgcat \"" .. absolutePath .. "\" ; read'"
5250
end
5351
elseif term == 'kitty' then
5452
if vim.fn.has('win32') == 1 or vim.fn.has('win64') == 1 then
5553
print('Kitty not supported on windows')
5654
else
57-
command = 'silent !kitten @ launch --type=window kitten icat --hold '
58-
.. '\''
59-
.. absolutePath
60-
.. '\''
55+
command = 'silent !kitten @ launch --type=window kitten icat --hold "' .. absolutePath .. '"'
6156
end
6257
else
6358
print('No support for this terminal.')

0 commit comments

Comments
 (0)