Skip to content
stawan15Public

Latest commit

 

History

44 Commits

Folders and files

Repository files navigation


litty

litty demo

Install

Platform Command
macOS (Homebrew) brew install --cask stawan15/tap/litty
Linux (Homebrew) brew install stawan15/tap/litty
Any (Rust) cargo install litty-term or cargo binstall litty-term
Nix nix run github:stawan15/litty
Arch (AUR) yay -S litty-bin
Debian / Ubuntu sudo apt install ./litty_<version>_amd64.deb (from Releases)
Fedora / RHEL sudo dnf install ./litty-<version>-1.x86_64.rpm (from Releases)
macOS / Linux script curl -fsSL https://raw.githubusercontent.com/stawan15/litty/master/install.sh | sh
macOS by hand open the .dmg from Releases and drag litty to Applications

The macOS app is not notarized. Homebrew and the script clear the download quarantine for you; after a manual download, right-click the app and choose Open, or run xattr -dr com.apple.quarantine /Applications/litty.app.

Build it yourself with cargo build --release (Linux) or packaging/build-app.sh (macOS app + dmg).

A small, fast terminal for macOS and Linux. Zero config: no settings file.

cargo run --release            # login shell
cargo run --release -- -e cmd  # run a command instead
litty img photo.jpg            # show pictures in the terminal you're in

Configuration (optional)

litty needs no configuration. On macOS, litty → Settings… (Cmd+,) changes the common settings with native controls; on Linux, Ctrl+Shift+, (or Settings… in the right-click menu) opens the file in your editor. The file is ~/.config/litty/config ($XDG_CONFIG_HOME/litty/config), one key = value per line, # for comments:

theme = dark          # dark | light | auto (auto follows the system appearance at startup)
font-size = 14        # points; overrides the zoom remembered from the last session
cursor = block        # block | bar | underline
cursor-blink = false
tray = true           # macOS menu-bar hamster; false removes it
font = JetBrains Mono # a family name or a path to the regular .ttf/.otf
padding = 10          # points around the text
scrollback = 20000    # lines kept per pane (up to 200000)
background = #1a1b26  # also foreground, selection, cursor-color, color0 … color15
keybind = ctrl+shift+k = split-right   # or `= none` to pass the keys to the program
restore = true        # reopen the tabs, splits and folders open at Quit
quick-terminal = ctrl+`   # macOS: a system-wide key that drops a terminal from the top
term = xterm-litty    # TERM for programs (default xterm-256color; see below)
paste-warning = true  # ask before pasting several lines into a shell
background-opacity = 1.0   # macOS: 0.3 … 1.0; below 1 the desktop shows through
background-blur = false    # macOS: blur what shows through

Keybind actions: copy, paste, copy-output, new-tab, new-window, close, split-right, split-down, find, clear, zoom-in, zoom-out, zoom-reset, next-tab, prev-tab, next-pane, prev-pane, prev-prompt, next-prompt, toggle-zoom, record, update, reopen-tab, settings, open-link. Changes apply as soon as litty's window is back in front (colours already on screen and in the scrollback follow the new theme); quick-terminal applies at the next start.

term = xterm-litty tells programs about litty's extras (undercurl, truecolor, synchronized output) through its own terminfo entry, installed with the packages and the app. TERM stays xterm-256color by default because hosts you ssh into don't have the entry; copy it there with infocmp -x xterm-litty | ssh host tic -x -. Programs can also check TERM_PROGRAM=litty.

Terminal features

Truecolor, 256 colours, bold/italic, underline styles (single, double, curly, dotted, dashed) and colours (SGR 4:n, 58), wide characters and combining marks (Thai), colour emoji including flags, skin tones and ZWJ sequences (drawn over the cells programs count, so the cursor never drifts), mouse reporting (SGR), bracketed paste, focus events (1004), synchronized output (2026), OSC 7/8/52/133, notifications (OSC 9, OSC 777), colour queries (OSC 4/10/11/12), DECRQM, DSR, XTWINOPS size reports, alternate screen, scrollback with reflow.

  • Images: litty img photo.jpg shows PNG and JPEG pictures right in the terminal, no other tools needed (fitted to the window, turned upright by EXIF, works over ssh when the remote end has litty). Underneath is the Kitty graphics protocol (PNG, RGB, RGBA; inline, file or temporary file), so kitten icat, chafa, timg, yazi and image.nvim work too. Images scroll with their text and each pane keeps at most 64 MB of them. Not yet: sixel, shared memory, Unicode placeholders.
  • Kitty keyboard protocol (all five enhancement flags), so neovim, helix and fish can tell Ctrl+I from Tab, see key releases and so on.
  • VT100/VT220 details checked with vttest: insert mode, autowrap off, origin mode, reverse screen, settable tab stops, DEC line drawing, cursor save with attributes, DECALN, RIS. 132-column mode clears the screen but keeps the window size (like xterm by default).
  • Fonts: a missing character is looked up in fontconfig (CJK, Hangul, Indic …) when the built-in list has no font for it.

Updates

litty checks for a newer release when it starts, at most once an hour (a single request to GitHub; turn it off with LITTY_NO_UPDATE_CHECK=1). When one exists a small ↑ litty x.y.z notice appears in the corner of the window. Click it or press Cmd+Shift+U (Ctrl+Shift+U on Linux) to open it: Enter downloads the release in the background and installs it when you quit, Esc skips that version. If litty came from the .deb or .rpm, Enter downloads the new package and installs it right away (the system asks for your password), and the next launch runs it. Downloads are verified with an ed25519 signature before anything is replaced. If another package manager installed litty (Homebrew, Nix, cargo), the notice shows the command to run instead and Enter copies it.

On macOS a small hamster sits in the menu bar. It runs in its wheel while a command is running in any tab (zsh, bash, fish, or any shell that emits OSC 133), and stuffs its cheeks while an update downloads; a blue dot means an update is ready. Its menu can check for updates, install one, open a window or quit. When nothing is happening it stays still and costs no CPU.

What makes it different

  • Command blocks. With zsh, bash (4.4+ for command names) or fish (all auto-enabled) or any shell that emits OSC 133, failed commands get a faint red tint on their output, and slow or failing commands show exit N 1.2s at the end of the command line. Cmd+Up / Cmd+Down jump between prompts. Cmd+Shift+C copies the last command's output (without the prompt); Cmd-click a prompt to select that command's output.
  • Done notifications. When a command that ran 8 s or longer finishes while litty is in the background, the Dock icon bounces, the menu-bar hamster cheers (exit 0) or looks dizzy (failure), and a notification says what finished and how long it took ("cargo build — Done in 2m13s"). Clicking it brings you to that tab. On Linux the notification goes through notify-send. Programs can post their own the same way with OSC 9 or OSC 777 (at most one every 2 s).
  • Thai word selection. Thai is written without spaces, so double-clicking Thai text picks the dictionary word under the pointer instead of the whole line (maximal matching over PyThaiNLP's CC0 word list, loaded on first use).
  • Recordings. Cmd+Shift+R (Ctrl+Shift+R on Linux) records the pane as an asciinema cast on your Desktop; press it again to stop. Play it with asciinema play or embed it on a web page.
  • Tabs and splits. Cmd+T opens a tab in the current directory. On macOS tabs are native window tabs (real NSWindows in one tab group: drag to detach, Mission Control, the system tab bar); on Linux litty draws its own tab bar. Cmd+D splits right, Cmd+Shift+D splits down; drag a divider to resize; inactive panes are dimmed. Cmd+Shift+Enter zooms one pane.
  • Reflow. Resizing re-wraps lines (prompts stay intact), keeping the cursor on its text.
  • Ligatures (=>, !=, ->, <=, |>, ...) with Maple Mono, plus bold-as-bright colours, block / underline / bar cursors (blinking when an application asks), double-click to select a word, triple-click a line, and the window remembers its size and zoom.
  • Scroll rail. The right edge shows where you are in the history; failed commands and find matches appear as ticks. Click or drag it to jump.
  • Find (Cmd+F): highlights every match, Enter / Shift+Enter to step, Esc to close.
  • Links: hold Cmd (Ctrl on Linux) and click a URL.
  • Right-click menu: Copy, Paste, Open Link, Split, Clear, Reopen Closed Tab, Settings (native on macOS).
  • Drag and drop: drop files on the window to type their paths, escaped for the shell.
  • Safe paste: pasting several lines into a shell without bracketed paste asks first (Enter pastes, Esc cancels), and a pasted "end of paste" sequence can't break out of it.
  • Progress: programs that report progress (OSC 9;4: winget, systemd, newer cargo) get a thin bar along the top of the pane and a percentage on the Dock icon.
  • Maple Mono NF (rounded, with Nerd Font icons and powerline glyphs) is used automatically when installed in ~/Library/Fonts, ~/.local/share/fonts or ~/.fonts, or a folder inside them (files MapleMono-NF-{Regular,Bold,Italic,BoldItalic}.ttf, SIL OFL); otherwise Menlo / DejaVu Sans Mono.
  • Nerd Font icons work with any font: litty has Symbols Nerd Font Mono (MIT) built in, and draws powerline arrows to fill the cell.
  • Correct Thai (tone marks and vowels stack on the base letter), procedural box drawing, bold/italic/underline, truecolor, 20k lines of compact scrollback.

Keys

Key Action
Cmd+C / Cmd+V Copy selection / paste (Ctrl+Shift on Linux)
Cmd+T / Cmd+W New tab / close pane or tab (Ctrl+Shift+T / W on Linux)
Cmd+Shift+T Reopen the closed tab, with its splits and folders (right-click menu on Linux)
Cmd+, Settings (Ctrl+Shift+, on Linux)
Cmd+Shift+[ / ] , Ctrl+Tab Previous / next tab
Cmd+1 … 8, Cmd+9 Go to tab N / last tab (Alt+N on Linux)
Cmd+D / Cmd+Shift+D Split right / down (Ctrl+Shift+O / E on Linux)
Cmd+[ / ] Previous / next pane
Cmd+Option+arrows Focus the pane in that direction
Cmd+Ctrl+arrows / Cmd+Ctrl+= Move the split / equalize splits
Cmd+Shift+Enter Zoom the focused pane
Cmd+Shift+C Copy the last command's output
Cmd+Shift+R Start / stop recording the pane (asciinema)
Cmd+K Clear screen and scrollback
Cmd+N New window
Cmd+Q Quit, keeping tabs and splits for next time (Ctrl+Shift+Q on Linux)
Cmd+F Find
Cmd+Up / Down Previous / next prompt
Cmd+Left / Right / Backspace Start of line / end of line / delete line
Cmd+= / Cmd+- / Cmd+0 Zoom in / out / reset
Shift+PageUp / PageDown / Home / End Scroll history
Option+Left / Right Word left / right

Mouse-aware programs (vim, tmux, htop) receive the mouse; hold Shift to select text instead.

Debugging: LITTY_LOG=/tmp/lt.log litty records every byte read from the shell, every key sent and every resize with timestamps, so a display glitch can be replayed exactly.

Releases

Packages

Used by

Contributors

Languages