Documents

Brief

Alt+click a file path anywhere in a pane and the file opens inside Terminal Delight, in a floating square beside the line that printed it. Pictures, Markdown, HTML pages, PDFs, video and sound all open this way. Esc closes the square, and everything else you type still goes to the prompt underneath.

Ctrl+Alt+click opens the same file in a new pane beside the one you clicked, where it fills the pane and comes back after a restart. Shift+click shows the file in your file manager, and Ctrl+click hands it to your desktop's own app.

Pictures and Markdown need nothing extra. HTML pages need Chromium, PDFs need poppler, and video and sound need mpv. When one is missing, the file opens in your desktop's own app and a chip on the line says why. HTML pages are drawn with the network off unless documents.toml allows it.

A path that Claude Code or Codex wrapped across two rows opens whole, and so does a name in an ls listing.

Technical has every click, the keys while a square is up, what each kind of file needs, and the documents.toml keys.

Technical

Documents

Opening a file#

Every modified click on a path or link goes through one table, read top to bottom; the first row that matches decides.1

ClickOnDoes
Ctrl+Alt+clicka file Terminal Delight can drawOpens it in a new pane to the right, with focus left where it was. A pane in the tab already showing the file comes forward instead.
Alt+clicka file Terminal Delight can drawOpens it in a floating square over this pane.
Alt+click againthe file the square is showingMoves the square into a pane beside, as its ⇲ split does.
Alt+clicka command line, with no file under the pointerCopies the command.
Shift+click, or Super+Ctrl+clicka file on this diskShows it in the file manager, selected.
Shift+click or Ctrl+clickany linkOpens it with the desktop's own app.

Holding Alt over a path that opens shows the chip ◳ alt+click · open here. Right-click a path for ◳ Open here and ⤢ Open beside (on a file that opens), ↗ Open with desktop, ⌖ Reveal in folder (on a file on this disk) and ⎘ Copy link. The same clicks work on a path in the FOCUS reader, read against the pane's folder.1

Which paths open#

The name decides first, matched without regard to case. Then the first sixteen bytes of the file must agree, so a log file named .png doesn't open as an empty square.2

KindNamesThe bytes must
Picture.png .jpg .jpeg .webp .gif .bmp .svgbe that picture (SVG is text, so its name is enough). A file with no extension opens as a picture when its bytes are one.
Markdown.md .markdownnothing; the name is enough
HTML.html .htmnothing; the name is enough
PDF.pdfstart with %PDF-. A file with no extension that starts with it is a PDF too.
Video.mp4 .m4v .mov .webm .mkv .ogv .avicarry a video container's signature
Sound.mp3 .m4a .aac .flac .wav .ogg .oga .opus .webacarry a sound container's signature

A directory, a file that can't be read, or a file whose bytes contradict its name doesn't open, and the click does what it would have done anyway.

Paths that a program broke across rows open whole, from either row:2

  • A path the terminal wrapped at the pane's edge.
  • A path Claude Code broke across rows. Its replies are indented two columns, and the second half starts at that margin. Where the break could be read two ways, the reading that names a file on disk wins. A path broken inside a cell of a table Claude Code drew opens whole too.
  • A file reference Codex prints in parentheses across indented rows. A relative one, such as (reports/brief.html), opens from the pane's folder.

A name in a directory listing opens by Alt+click. When the listing puts each file's path behind its name, as ls --hyperlink and eza --hyperlink do, the click opens exactly the file listed, wherever the shell has gone since. A plain name with no link behind it opens only if the pane's own folder holds a file by that name. If your ls writes no links, add --hyperlink=auto to it.2

The square#

pane header $ ls --hyperlink reports notes.md brief.html chart.png paper.pdf $ _ ☰ brief.html − fit + ⇲ split ↗ desktop ✕ esc the page, drawn by Chromium and scrolled by Terminal Delight side: 56% of the screen's width, or 84% of its height when smaller right-aligned, 12 px in from the edge, 6 px below the clicked row typing still reaches the prompt
Figure 1. A square opens next to the line you clicked and never covers the whole pane. Here the pane is short enough that 84% of its height sets the side, which works out to 336 px for a screen 680 by 400. When the square doesn't fit below the row, it ends just above it. Drawn from the placement rule (float_home in docopen.rs) at those numbers; it is not a screenshot. The bar on the right edge is the reading rail.

The strip across the top carries ☰ and the file's name, then −, the zoom and + for anything that zooms, then ⇲ split, ↗ desktop and ✕ esc. The zoom reads fit or a percentage; pressing it switches between fitting the square and actual size. Pictures zoom from 10% to 800%, and Markdown, pages and PDFs from 50% to 300%.13

Drag the strip to move the square. Drag a side or the bottom edge to resize it, or any of the four corners; it never gets smaller than 200 by 120 px. A document taller than the square draws a column of blocks down its right edge, lit where you are and dimmer where you've been, with the percentage read so far beside its top. A document that fits draws none.13

Opening another document replaces the square. A square holding notes you haven't saved stays once and says so; see Decision briefs.

Keys while a square is up#

KeyDoes
EscClose the box on top. A clip closes first, and the square it covered comes back. A brief's own dialog closes before the square does.
wheel over the squareScroll or pan the document.
Ctrl+wheel over the squareZoom the document.
Alt+RRead the document in the FOCUS reader. The square says being read until the reader closes, and the document goes back into it at the zoom it had.
Ctrl+Shift+Enter, over a brief↪ send its notes to the agent beside it (Decision briefs).
Ctrl+WClose the box on top, one per press.
Ctrl+↑ / ↓Step the document 48 px, a wheel notch.
Ctrl+Shift+↑ / ↓Page it.

Other keys reach the pane as they would with no square up, so you can read beside the prompt and keep typing. In 0.4.0, Ctrl+W with a square up still closes the whole tab, after asking.5

Ctrl+W closes the box on top, one per press, as Esc does. Closing the tab moves to Ctrl+Shift+W, which still asks first, and with no box open Ctrl+W reaches the shell or agent as delete-word again. While a square floats, Ctrl+↑/↓ step it and Ctrl+Shift+↑/↓ page it, so those chords don't reach the shell; the Document face takes them too, and with a brief's note box open they turn the notes. Ctrl+PgUp/PgDn still switch tabs. With no square up, nothing is taken.5

A document in its own pane#

Ctrl+Alt+click, ⤢ Open beside or ⇲ split puts the file on a new pane's Document face. It fills the pane, bent with the glass, over a shell that keeps running underneath; Alt+K flips between them. A square moved there keeps its zoom and its place. A document pane comes back after a restart at the place you were reading. A tab already holding four panes has no room, so the file opens in a square instead and its strip says four panes · opened here.1

Key, on the Document faceDoes
0Fit.
1Actual size.
+ or =, -Zoom in, zoom out.
arrowsPan or scroll 48 px.
PgUp PgDnMost of a screen.
Space, ← →, M, on a video or soundPause, skip five seconds, mute.
Alt+KBack to the terminal.

Every other key stops at the face, so nothing is typed into the hidden shell.1

Pictures#

PNG, JPEG, WebP, GIF, BMP and SVG, with nothing to install. A picture with a side longer than the graphics card can hold opens a square that says so, with its size and the card's limit, and ends so ctrl+click the path to open it with the desktop.3

Markdown#

Headings, paragraphs, lists, tables, code blocks, quotes and rules, drawn in the pane's own colours: headings, links, list markers and the quote bar take the theme's accent. A local picture on a line of its own is drawn. A remote one is never fetched, and shows as a line such as image · chart.png — on example.com, not fetched. Links are followed. While the file is open it is checked for changes every half second, and an edit is drawn again with your place kept. Nothing extra to install.3

HTML pages#

Headless Chromium draws the page as pictures, and Terminal Delight scrolls them itself. One browser serves every page Terminal Delight opens, each page in a fresh context on an empty profile made for it, so a page's localStorage is always empty. The browser closes after five minutes with nothing to draw and starts again for the next page. Chromium's own sound is muted.3

The network is off. Every page is told to block http, https, ws and wss, and the browser is pointed at a proxy that isn't there and a resolver that finds nothing, so a brief that loads a web font draws with the fallback. network = "allowed" in documents.toml turns it on. Renders are kept on disk, up to 256 MiB, in $XDG_CACHE_HOME/terminal-delight/pages (~/.cache/terminal-delight/pages when it is unset), so a page opened again draws at once.34

A video or audio player on the page plays as a clip when you press it. One the page plays from its own script has no file to open, and says so.3

A page with a link inside an SVG drawing, such as a diagram whose boxes link to sections, opens. In 0.4.0 such a page fails to open. The links work too, including jumps to a heading in the same page.7

PDFs#

One column of pages, with the page in view counted at the bottom right. poppler redraws each page at the size it is shown, so zoomed text stays sharp. A link to paper.pdf#page=3 in a Markdown or HTML document opens it on page 3, and a PDF rewritten while it is open is read again on the page you were reading. A PDF locked with a password says This PDF is locked with a password. Ctrl+click its path to open it on the desktop, which can ask for it. A page still being drawn after twenty seconds is stopped: poppler was still drawing this after twenty seconds, and was stopped.3

Video and sound#

In a square, a video or sound is a clip: it opens in its own box inside the square it covers, with that square's rim showing round it, plays once with sound, and closes at its end. The square it covered comes back exactly as it was, so a video pressed on a page leaves the page where you were. A sound gets a band only as tall as its waveform, drawn in the pane's accent colour, so the page under it stays in sight. A new clip replaces the one that's up.13

The bar along the bottom has ▶ or ❚❚, the time, a track to press or drag, and the sound switch. A press on the picture pauses or plays it. In a square, Space, the arrows and M stay the prompt's. On the Document face a video loops, and those keys work.3

What each kind needs#

KindNeedsLooked for
Pictures, Markdownnothing extra
HTMLChromiumthe chromium path in documents.toml; otherwise chromium, chromium-browser, google-chrome-stable and google-chrome on PATH, in that order
PDFpoppler's pdfinfo and pdftoppmon PATH
Video, soundlibmpv, which comes with mpvlibmpv.so.2, then libmpv.so.1, then libmpv.so

Each is looked for the first time a file needs it. A missing one is looked for again thirty seconds later, so installing it needs no restart. Without it, the file opens in your desktop's own app, no square opens, and a chip on the clicked line says why, such as no Chromium found · ↗ opened with the desktop, no poppler · ↗ opened with the desktop or no libmpv · ↗ opened with the desktop. A Chromium that is there but won't start is found once the square is up: the square says why, and the file goes to the desktop.14

documents.toml#

~/.config/terminal-delight/documents.toml, or under $XDG_CONFIG_HOME when it is set. It only exists if you write it, and every key is optional. All four sit under [html].4

KeyTakesWhen unset
engine"snapshot", or "off" to send every HTML file to the desktop"snapshot"
chromiuma path to the browserthe first of the four names on PATH
gpu"vulkan", which starts the browser with Vulkan through ANGLEheadless defaults
network"allowed" or "blocked"blocked
[html]
network = "allowed"

A word Terminal Delight doesn't know is an error that names it, so a typo in network can't open pages to the internet. A file that doesn't parse, or a network or gpu it doesn't know, sends HTML to the desktop with documents.toml could not be read (…). An unknown engine says documents.toml asks for an HTML engine called "…", and the only one TD has is "snapshot". A chromium path with nothing there says No Chromium at … (the chromium setting in documents.toml).

The file is read the first time an HTML file opens. Once a page has been drawn, a change to it takes effect when Terminal Delight restarts; a setting that left HTML unavailable is read again after thirty seconds.4

A link to a heading in the same document scrolls to it. A link to a file Terminal Delight can draw opens in the same square, or on the same Document face, so reading a set of linked notes stays in one place; a video or sound opens as a clip over the square instead. A web or mail address, or a local file Terminal Delight doesn't draw, goes to the desktop, as Ctrl+click does. Any other scheme is refused, because a document is someone else's text and a click in it shouldn't reach every handler the desktop has registered.2

Agents and scripts#

An agent opens a file it made with the MCP tool open_document, which needs the server's writes switch. It takes path, an absolute path or file:// URL, and placement: "here", the default, floats it over the agent's own pane as Alt+click does, and "beside" opens it in a pane to the right as Ctrl+Alt+click does. It only ever opens in the agent's own pane or tab. In 0.4.0, "here" replaces a square you have open, unless that square holds unsaved notes, which answers err.6

An agent never replaces a square you have open. If a square is up over its pane, whatever it shows, nothing opens: the file is kept as the pane's handover on the artifact rail, and the agent's answer begins held (over MCP, a success with "held": true). A clip still opens over the square, since it replaces nothing. A click, the rail and ctl doc here still replace the square, because a person asked.6

From a script, terminal-delight ctl has doc here <path>, doc beside <path>, doc close and doc scroll <pixels>.6

Notes on a document#

A decision brief opened in a square or a document pane shows its note buttons, counts and CONCUR stamps, and saves your notes into its own file. A Markdown file takes notes too. All of that is on Decision briefs.

What would prove this wrong#

A key other than Esc (and, in 0.5.0, Ctrl+W and the Ctrl+arrows) that stops reaching the prompt while a square floats; an HTML page that loads a web font with network unset; or a file that opens in a square when its first bytes contradict its name.

Sources

  1. The click table, the square's placement, size and strip, the clip and the Document face's keys: docopen.rs (click_intent, link_menu, float_home, clip_home, sound_box, doc_face_key) and pane/doc.rs (open_float, open_clip, square_el, engine_refused, doc_wheel); strings in lang.rs.
  2. Which files open, by name and first bytes: doc_kind and drawable_document in docopen.rs; links inside a document: link_route there and follow_doc_link in pane/doc.rs; wrapped paths, table cells, Codex references, OSC 8 links and bare names: continuation_start, wrapped_link_candidates, hyperlink_reading and bare_name_reading in pane.rs, tested in pane/behaviour.rs.
  3. Drawing each kind: docview.rs (READING_ZOOM, WATCH_EVERY) and docview/: image.rs (ZOOM_STEPS), markdown.rs, snapshot.rs (IDLE_SHUTDOWN, the network block), cache.rs (CAP_BYTES), pdf.rs, poppler.rs (RENDER_LIMIT), video.rs, mpv.rs, progress.rs; messages in lang/parts.rs.
  4. documents.toml as parsed: docview/pref.rs; when it is read and how a missing engine is asked again: engine and ASK_AGAIN in docview.rs; the reasons: Unavailable in docview/engine.rs; the libmpv names: SONAMES in docview/mpv.rs.
  5. Keys: the routing ladder in keylayer.rs (0.4.0: Layer::Float takes Escape; pane_chord keeps Ctrl+W as close-tab); 0.5.0: glow_chord and the Ctrl+W arm of pane_chord in keylayer.rs, and DocumentView::glow in docview.rs.
  6. open_document: mcp.rs and open_here in pane/doc.rs; the held answer: open_here in pane/doc.rs; ctl doc: ctl.rs.
  7. Links in SVG: resolvedHref in docview/extract.js, with real-Chromium fixtures in tests/snapshot_engine.rs.