I would like to display an image in a terminal inline, without a line break afterwards. I came across the Sixel format, but all examples I've found move the cursor to the next line after the image is displayed.
% cat hi.sixel; echo rest
(sixel image here)
rest
%
Using the script from Sixel Demo:
#!/bin/sh
echo
echo
echo
echo -n before
printf 'G1BxIzA7MjswOzA7MCMxOzI7MTAwOzEwMDswIzI7MjswOzEwMDswIzF+fkBAdnZAQH5+QEB+fiQjMj8/fX1HR319Pz99fT8/LSMxITE0QBtcCg==' | base64 -d
echo -n after
echo
echo
echo
I get the following output (note an extra blank line between sixel and "after"):
% cat hi.sixel; echo rest
(sixel image here)rest
%
This is possible (assuming the terminal supports it) by first emitting the ESC [?8452h
control sequence.
echo -ne "\033[?8452h" && cat image.sixel && echo "<-- Bottom-Right"
See:
mintty
)xterm
)