<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: lancetfish</title>
    <description>The latest articles on DEV Community by lancetfish (@liyutongzuishuai).</description>
    <link>https://dev.to/liyutongzuishuai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4271640%2Ff48de35c-2d82-4f4e-9924-5deb14a1a359.jpg</url>
      <title>DEV Community: lancetfish</title>
      <link>https://dev.to/liyutongzuishuai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/liyutongzuishuai"/>
    <language>en</language>
    <item>
      <title>I Built a Tiny Terminal on suckless st with Kitty Graphics and a Cursor Trail</title>
      <dc:creator>lancetfish</dc:creator>
      <pubDate>Sun, 29 Nov 2026 05:02:51 +0000</pubDate>
      <link>https://dev.to/liyutongzuishuai/i-built-a-tiny-terminal-on-suckless-st-with-kitty-graphics-and-a-cursor-trail-4g2k</link>
      <guid>https://dev.to/liyutongzuishuai/i-built-a-tiny-terminal-on-suckless-st-with-kitty-graphics-and-a-cursor-trail-4g2k</guid>
      <description>&lt;p&gt;I use &lt;code&gt;st&lt;/code&gt; every day. It's small, fast, and stays out of my way. But two things kept nagging me: I couldn't see images inline in the terminal, and — honestly — I wanted the cursor to feel a little less dead.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;fat&lt;/strong&gt;: a small X11 terminal based on suckless &lt;code&gt;st&lt;/code&gt;, with the Kitty graphics protocol, a fading cursor trail, and Foot-inspired defaults. Still plain C with Xft and XRender. No OpenGL, no GUI toolkit. MIT licensed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fie5v0zditwpcqkncnytt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fie5v0zditwpcqkncnytt.png" alt="fat displaying a PNG inline with the Kitty graphics protocol" width="520" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kitty graphics, inline:&lt;/strong&gt; PNG, RGB, and RGBA images rendered right in the terminal, with transparency, scaling, cropping, layering, and scrolling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cursor trail:&lt;/strong&gt; the cursor moves immediately, and a short trail tapers and fades behind it over up to 220 ms. When the cursor is still, nothing animates — it costs nothing at rest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Foot-inspired defaults:&lt;/strong&gt; frameless window, dark Starlight colors, 60%-opaque background, BitstromWera Nerd Font Mono at 20 pt if installed (any monospace font works as a fallback).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scrollback:&lt;/strong&gt; 1,000 lines on the main screen. Wheel or &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;Page Up&lt;/code&gt; / &lt;code&gt;Page Down&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Input methods:&lt;/strong&gt; fcitx5 and ibus work over XIM, even when the session only exported the input method to Wayland clients.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Kitty graphics part
&lt;/h2&gt;

&lt;p&gt;This is the piece I spent the most time on. The Kitty graphics protocol lets a program send an image to the terminal as escape sequences carrying base64 payloads — chunked, optionally zlib-compressed, with the terminal doing the decoding and placement.&lt;/p&gt;

&lt;p&gt;I implemented the &lt;strong&gt;direct-stream subset&lt;/strong&gt;: detection, chunking, zlib compression, reusable placements, and deletion, with a bounded 32 MiB image cache. Try it with &lt;code&gt;kitten&lt;/code&gt; installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kitten icat --transfer-mode=stream ./image.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things I deliberately left out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;No disk or shared-memory transfer modes.&lt;/strong&gt; Graphics escape sequences never open local image files. A terminal that renders arbitrary files from escape sequences is a footgun; the stream subset keeps the attack surface small.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No animation.&lt;/strong&gt; Static images only — no animation, no Unicode placeholders, no indexed-color images. Animation belongs in a bigger terminal; fat is trying to stay small.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Kitty keyboard protocol and Sixel are separate protocols and are not implemented either.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cursor trail
&lt;/h2&gt;

&lt;p&gt;The trail is drawn with XRender. Each cursor move leaves a short tapering segment that fades out within 220 ms, and the trail is only redrawn while the cursor is actually moving. At rest, no animation frames are scheduled at all — the terminal is as idle as plain &lt;code&gt;st&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It's tunable in &lt;code&gt;config.h&lt;/code&gt; (&lt;code&gt;cursortrailms&lt;/code&gt;, &lt;code&gt;cursortrailcells&lt;/code&gt;, &lt;code&gt;cursortrailopacity&lt;/code&gt;), and &lt;code&gt;fat -N&lt;/code&gt; disables it for one window.&lt;/p&gt;

&lt;h2&gt;
  
  
  The boring parts that matter
&lt;/h2&gt;

&lt;p&gt;A terminal lives or dies on the unglamorous details, so a few notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Input methods:&lt;/strong&gt; Wayland sessions often export &lt;code&gt;GTK_IM_MODULE&lt;/code&gt; and &lt;code&gt;QT_IM_MODULE&lt;/code&gt; but not &lt;code&gt;XMODIFIERS&lt;/code&gt;, which is all an X11 client needs. fat looks for a registered XIM server itself and sets &lt;code&gt;XMODIFIERS=@im=fcitx&lt;/code&gt; or &lt;code&gt;@im=ibus&lt;/code&gt; when the session left it unset.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing dependencies:&lt;/strong&gt; if a development package is missing, &lt;code&gt;make&lt;/code&gt; tells you which ones and prints the install command for your distro, instead of failing somewhere inside the compiler.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tests:&lt;/strong&gt; &lt;code&gt;make check&lt;/code&gt; covers cursor-trail geometry; &lt;code&gt;make check-x11&lt;/code&gt; uses Xvfb, xauth, and Python 3 to check terminal replies and rendered pixels.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Fedora&lt;/span&gt;
sudo dnf install gcc make pkgconf-pkg-config ncurses \
  libX11-devel libXft-devel libXrender-devel fontconfig-devel \
  freetype-devel libpng-devel zlib-devel

&lt;span class="c"&gt;# Debian / Ubuntu&lt;/span&gt;
sudo apt install build-essential pkg-config ncurses-bin \
  libx11-dev libxft-dev libxrender-dev libfontconfig-dev \
  libfreetype-dev libpng-dev zlib1g-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/liyutongzuishuai/fat.git
&lt;span class="nb"&gt;cd&lt;/span&gt; fat
make
tic -x -o &lt;span class="s2"&gt;"$HOME/.terminfo"&lt;/span&gt; fat.info
./fat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It sets &lt;code&gt;TERM=fat-256color&lt;/code&gt;; for SSH hosts that don't recognize it, the FAQ in the repo covers the terminfo setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest state of the project
&lt;/h2&gt;

&lt;p&gt;It's early — version 0.2.1, X11/XWayland only, no native Wayland backend. The graphics subset is intentionally narrow, and there's plenty I haven't tried yet (different fonts, exotic &lt;code&gt;terminfo&lt;/code&gt; setups, heavy image workloads).&lt;/p&gt;

&lt;p&gt;If you use &lt;code&gt;st&lt;/code&gt;, or you've ever wanted inline images in a terminal that stays small, I'd love to hear what breaks for you. Issues and PRs are welcome.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/liyutongzuishuai/fat" rel="noopener noreferrer"&gt;https://github.com/liyutongzuishuai/fat&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>linux</category>
      <category>showdev</category>
      <category>terminal</category>
    </item>
  </channel>
</rss>
