Snippets and drag and drop
Saved commands with placeholders, and what happens when you drop a file on a terminal.
Two small features that share one idea: getting text into a terminal without typing it, and never pressing Return for you.
Snippets
A snippet is a name and a command. The list starts empty; it is yours to fill.
The sidebar’s Snippets panel has a + for a new one, and the palette
(⌘K) has New Snippet… and Open Snippets File. A snippet
row shows its name over its command.
A click on a row types the command into the selected terminal without running it — Return stays your call. The row’s menu has the full set:
Run · Insert · Edit… · Delete
From the palette, ↩ runs a snippet and ⌥↩ inserts it.
Placeholders
{{name}} in a command marks a value you are asked for when you use it:
Name: Deploy a service
Command: deploy.sh release {{service}} --region {{region}}
A name may hold letters, digits, _ and -. Placeholders are asked for in
the order they first appear, once each however often they are repeated, and
a value you leave empty is left in place rather than guessed at.
Using a snippet with placeholders brings up a small sheet with one field per placeholder and the filled command underneath, with Insert and Run. From the palette they are filled in the detail pane instead, and ↩ is not available until each has a value.
Where they live
~/Library/Application Support/Overterm/snippets.json
Pretty-printed with sorted keys, written atomically — a JSON file you can edit by hand. Nothing is written until there is a snippet to write, and a file that cannot be read is set aside rather than overwritten. Open Snippets File in the palette opens it, with the path as its subtitle.
Dropping things on a terminal
Every pane takes a drop. A drop is a paste, never a Return: the references go in separated by spaces with a trailing space, the pane takes the keyboard, and nothing runs until you press Return.
What a drag can carry
Checked in this order, the first match winning:
- File URLs — Finder, the Desktop, Overterm’s own sidebar. Finder’s file-reference URLs are resolved to real paths.
- File promises — Photos, Safari, the screenshot thumbnail: files that
do not exist until someone asks for them. They are written into a folder
of their own under
~/Library/Caches/io.github.overcraft-hq.overterm/Drops/, with a 30-second limit; anything that never arrives is left out, and the rest keep the order they were promised in. Several drops stay in the order they happened. - Web URLs — inserted as they are.
- Text — inserted as it is, less line breaks at either end.
While you drag, the pane gets an accent border and a label saying what will happen: “Drop to insert path”, “Drop to insert @ reference”, “Drop to insert text”, with a count for several files. The label updates live as you press or release ⌥.
What goes in depends on what is running
| Running in the pane | A file goes in as |
|---|---|
| Claude Code — an image | its absolute path, whitespace and backslashes escaped |
| Claude Code — any other file, or a folder | @path, relative to where Claude is working when the file is inside it, else absolute; a folder with a trailing / |
| anything else — a shell, vim, Codex | the shell-quoted absolute path, as Terminal does |
| anything, with ⌥ held | the shell-quoted absolute path |
“Running in the pane” means a Claude process in that pane’s foreground process group — one you left running in the background does not count. The check is per pane, made afresh at each drop, off the main thread.
The forms are what they are because of how Claude Code reads a paste: it
takes each image path out of the text and replaces it with [Image #N]
placed before what is left, and it only recognises a backslash-escaped path
across several images. So images go last, the rest starts with a space, and
an @ would never end up directly after a ]. An @-mention is quoted as
@"path" where the plain form would be cut, and falls back to a plain quoted
path where neither form carries it — a # in the path, for instance, which
Claude Code reads as a line range.
Dragging a row out of the sidebar’s file tree works too; clicking, double-clicking and the row’s own menu are unchanged.
Pasting, and the clipboard
Two Ghostty settings are worth knowing beside this, both in Settings ▸ Terminal: Ask before pasting text that could run commands, and what happens when a program asks to read the clipboard (OSC 52) — ask, allow or refuse. Asking shows you what the program would get before you agree. See Settings.