title: Displaying a sixel image in a terminal without a line break afterwards
body: <p>I would like to display an image in a terminal inline, without a line break afterwards. I came across the <a href="https://en.wikipedia.org/wiki/Sixel" rel="nofollow noreferrer">Sixel</a> format, but all examples I've found move the cursor to the next line after the image is displayed.</p>
  <pre><code>% cat hi.sixel; echo rest
  (sixel image here)
  rest
  %
  </code></pre>
  <p>Using the script from <a href="https://en.wikipedia.org/wiki/Sixel#/media/File:Sixel_demo.png" rel="nofollow noreferrer">Sixel Demo</a>:</p>
  <pre class="lang-sh prettyprint-override"><code>#!/bin/sh
  echo
  echo
  echo
  echo -n before
  printf 'G1BxIzA7MjswOzA7MCMxOzI7MTAwOzEwMDswIzI7MjswOzEwMDswIzF+fkBAdnZAQH5+QEB+fiQjMj8/fX1HR319Pz99fT8/LSMxITE0QBtcCg==' | base64 -d
  echo -n after
  echo
  echo
  echo
  </code></pre>
  <p>I get the following output (note an <em>extra</em> blank line between sixel and &quot;after&quot;):</p>
  <p><a href="https://i.stack.imgur.com/teT5v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/teT5v.png" alt="&quot;before&quot; printed on the same line as the sixel, but &quot;after&quot; is on the line after next" /></a></p>
  <ul>
  <li>Is this behavior specified by the Sixel standard?</li>
  <li>How can I display a sixel image inline, like this?</li>
  </ul>
  <pre><code>% cat hi.sixel; echo rest
  (sixel image here)rest
  %
  </code></pre>