The terminal
The terminal engine is libghostty-vt, the terminal core of Ghostty. Escape sequences behave the way they do in Ghostty.
TERM
TERM is xterm-ghostty when Ghostty's terminal description is installed. Otherwise it's xterm-256color. insensical looks for the description under $TERMINFO, ~/.terminfo, /usr/share/terminfo, /usr/lib/terminfo and /etc/terminfo. insensical doesn't ship the description.
Over ssh to a machine that doesn't have that description, programs complain about an unknown terminal. Set TERM there, or install the description there.
Every pane also has these set: COLORTERM=truecolor, TERM_PROGRAM=insensical, TERM_PROGRAM_VERSION, INSENSICAL_PANE and INSENSICAL_SOCKET.
Scrollback
Each pane keeps 10 MB of history. That's an amount of memory, not a number of lines, and there's no setting for it. The history is held in the daemon's memory. Stopping, restarting and new versions covers what happens to it when the daemon stops.
If a window falls very far behind a flood of output, it's resynchronised, and the output nobody could have read is skipped.
When you switch to a tab, its panes can show empty for an instant, until each one receives its screen. If you scroll back into history that hasn't arrived, nothing shows that it's missing.
Text
- Font. The terminal and the interface use the same family.
font-sizeis in points, and the default is 12. On Linux a point is 1⅓ pixels, as in Ghostty, kitty and Alacritty. So 12 points is 16 pixels, and the size you set in those terminals gives the same text here. On macOS a point is a pixel (written, never run). Interface text is always 12 pixels. A row is 1.3 times the font's size high, rounded up. - There is no font weight setting. Text uses the family's regular face, and bold and italic use those faces. If your other terminal is set to semibold, text here looks thinner.
- There are no ligatures, and nothing is shaped across cells. Each cell's character is placed separately.
- Characters the font doesn't have come from the system's fallback fonts. That includes emoji.
- Icons in cells aren't fitted to their cell. A wide Nerd Font glyph can overlap its neighbour.
- Line, block and Powerline characters are drawn as shapes, on whole pixels, and don't come from the font. So lines join and blocks tile at any size and scale.
- Cursor: block, bar or underline, whichever the program asks for, in the theme's cursor colour or the program's.
- It blinks until a program asks for a steady one. Typing makes it visible and restarts the blink.
- Only the pane your typing goes to has a solid cursor. In every other pane, the cursor is the outline of a block and doesn't blink. The same is true of every pane while the window isn't in front, or while a panel such as the palette has the keyboard.
- A pane that was already running when the daemon was updated to the version that introduced this keeps a steady cursor until its program asks otherwise.
- Half-drawn screens are held. When a program says it's in the middle of drawing (synchronized output), its screen is shown when it says it has finished, or after one second.
Colours
- The sixteen named colours come from the theme. 256 colours and true colour are shown exactly as the program gives them.
- When a program asks the terminal for its colours, or whether it's dark, it gets the theme of the window that's showing it.
- On a light theme, text whose contrast with its background is less than 3:1 is painted in a darker shade of the same hue. Only the pixels change. What you copy is what the program wrote. Dark themes are painted exactly as asked.
Selecting and copying
- Drag to select. Click a second time to select the word, and a third time to select the line. Hold Alt while you drag to select a rectangle. Hold the pointer beyond the top or bottom to scroll.
- Selecting copies to the selection clipboard on systems that have one (Linux).
- Press
Ctrl+Shift+Cto copy to the clipboard. For a second, the selection turns the accent colour and "Copied" shows at the bottom of the pane. If nothing is selected, nothing is copied and no message shows. Wrapped lines are joined when you copy them. - "Select everything in the pane" is a command,
select-all. It has no default key. - Typing returns the view to the bottom and clears the selection.
- A selection belongs to the window you made it in. It stays on its text as output arrives.
Pasting
- Press
Ctrl+Shift+Vto paste the clipboard. PressShift+Insertor the middle button to paste what you last selected. - A paste that would run as it arrives is held. That means a paste of more than one line into a program that hasn't asked for pastes to be marked (bracketed paste), or any text that contains the sequence that ends a marked paste. A line at the bottom of the pane shows how many lines there are, with "Paste" and "Cancel" on it. Press Enter or click "Paste" to paste. Press Escape or click "Cancel" to drop it.
- Most shells ask for marked pastes, so they get multi-line pastes straight away.
Mouse and wheel
- A program that asks for the mouse gets presses, releases, motion and the wheel. Hold Shift to select text instead.
- The wheel scrolls history. In a full-screen program that didn't ask for the mouse, it moves through the file (arrow keys are sent). In a program that did ask, it's reported to the program.
- The wheel moves three rows per notch, and at most twelve steps per event.
- A scrollbar appears while the view is scrolled back, and when the pointer is at the pane's right edge. You can drag its thumb.
Finding text
Press Ctrl+Shift+F to open a field over the pane's top right corner.
- It finds text anywhere in the pane's history, ignoring case. It shows which match you're on and how many there are, and brings each match to the middle of the view, selected, so you can copy it.
- Press Enter to go to the previous (older) match, and Shift+Enter to go to the next. Press Escape to return to where the program is writing.
- A match can't span two rows, so text that wraps at the pane's edge isn't found across the wrap.
- There are no regular expressions.
Web addresses and paths
Ctrl+click a web address to open it (⌘+click on macOS).Ctrl+click the path of a file or directory to open it with whatever your desktop uses for that kind of file. A directory opens in the file manager.- Anything you can open is marked when the pointer is over it. It's underlined, and a line at the bottom of the pane shows the key and what it opens, as in "Ctrl+click opens http://localhost:5173/". While you hold
Ctrl, the pointer becomes a hand. A plain click doesn't open it, because a click in a terminal selects. - For addresses, only
http://andhttps://are ever opened. Brackets and punctuation around the address are left out. - A path is marked only if it leads to something that exists:
- It's read from the directory the pane's shell is in.
~/is the home directory. - A path that starts with a slash but doesn't exist from the root is tried from the pane's directory. That's how a bundler prints
/src/App.vue. - A line and column after the path, as in
src/main.rs:12:5, are left out and aren't passed on. The file opens at its beginning. - A bare word with no slash and no dot in it, such as
src, isn't looked up. - A file that can be run, and a
.desktopfile, are never marked or opened. That way, clicking something a program printed can't start anything. - There is no setting for which program opens a file.
- It's read from the directory the pane's shell is in.
- An address or path that continues onto the next row is found only up to the end of its row.
- Links that a program marks as links (OSC 8) aren't followed.
The clipboard and programs
- A program can put text on the clipboard (OSC 52). This is how an editor on another machine, reached over
ssh, copies:"+yin Neovim there lands on the clipboard here. - Only the program in the pane you're looking at can do this. That's the pane with the keyboard, in a window that's in front. A program in a tab you aren't on, or in a minimized pane, is ignored. So nothing can change what you're about to paste without you knowing.
- Text only, up to a megabyte.
clipboard = "never"turns it off completely.- No program can read the clipboard. A request to read it is ignored, and there's no setting to allow it. Pasting is always something you do.
What the terminal does not do
- Input methods (IME) and dead keys aren't handled. Chinese, Japanese and Korean input don't work, and neither do accents typed as two keys.
- Images (Kitty graphics, Sixel) aren't shown.
- Shell-integration marks (OSC 133) are read to learn when a command ends and how it ended. There is no jump between prompts.