Skip to content

Commit 8c5107f

Browse files
authored
Merge pull request #8 from ArkieCoder/kittysupport
Use system to run viu directly for Kitty image display
2 parents 197ebfa + db45113 commit 8c5107f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/stringformat.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ def iterm2?
5353
system("convert -density 130 #{pdf_file} #{png_file} >/dev/null 2>&1")
5454
if File.exist?(png_file)
5555
width = (cols * 0.75).to_i
56-
viu_output = `viu -w #{width} #{png_file} 2>/dev/null`
57-
if $?.success? && !viu_output.empty?
56+
if system("viu -w #{width} #{png_file} >/dev/null 2>&1")
5857
# Clean up
5958
tmp_file.unlink
6059
File.unlink(pdf_file)
6160
File.unlink(png_file)
62-
viu_output
61+
"" # Image displayed, return empty string
6362
else
6463
# Fallback if viu fails
6564
tmp_file.unlink

0 commit comments

Comments
 (0)