Command Configuration
Default Command
$SHELLenvironment variablepasswdentry (user information)
How do I pass arguments to the command?
How do I pass arguments to the command?
Include arguments in the command string:Ghostty executes this via
/bin/sh -c for shell expansion.Command Execution Modes
direct mode avoids the
/bin/sh roundtrip but doesn’t support shell features like:- Arguments with spaces
- Tilde expansion (
~) - Globs (
*.txt) - Shell variables
Initial Command
command setting.
Environment Variables
These variables override Ghostty’s automatic variables (like
GHOSTTY_RESOURCES_DIR).They do not affect commands run by Ghostty for other purposes (like open or xdg-open for URLs).Available since 1.2.0.Command Input
Send data to command on startup:Repeatable configuration. Data is concatenated directly with no separator.If any input source doesn’t exist, no input is sent at all.Changes only affect new terminals.Available since 1.2.0.
Command Behavior
Wait After Command
Abnormal Exit Detection
- Linux
- macOS
Requires non-zero exit code.
Confirm Close
When
true, Ghostty uses shell integration to detect if a process is running. Without shell integration, always confirms.Scrollback
Scrollback Limit
This is the total memory for scrollback + active screen. Enough memory is always allocated for the visible screen; leftover is scrollback.Scrollback is allocated lazily, so large values don’t immediately consume memory.This is per terminal surface, not application-wide.Changes only affect new terminals.
Scrollbar Visibility (macOS)
macOS only. GTK doesn’t yet support scrollbars.With
never, you can still scroll via mouse, keybinds, etc.Scroll to Bottom
keystroke: Scroll to bottom on keypress that sends data to PTYoutput: Scroll to bottom on new output (currently unimplemented)
Prefix with
no- to disable an option.Mouse Behavior
Mouse Reporting
toggle_mouse_reporting keybind.
Mouse Shift Capture
What's the difference between values?
What's the difference between values?
false/never: Apps can request shift withXTSHIFTESCAPE(or not withnever)true/always: Shift sent by default, apps can toggle withXTSHIFTESCAPE(or not withalways)
never if you always want shift to extend selection.Mouse Scroll Multiplier
Hide Mouse While Typing
Platform behavior may show mouse in other scenarios (e.g., macOS shows mouse when creating new windows/tabs/splits).
Click to Move Cursor
Requires shell integration (specifically prompt marking via OSC 133). Only works in primary screen mode.Works by synthesizing arrow key movements. Some edge cases may behave unexpectedly.
Click Repeat Interval
- macOS
- Other
Default determined by OS settings.
Right-Click Action
Focus Follows Mouse
Only applies to the currently focused window. Hovering over unfocused windows doesn’t change focus.
Selection
Selection Colors
See Appearance Configuration for selection color options.Selection Behavior
selection-clear-on-typing is triggered by:- Any non-modifier keypress that sends data to PTY
- Preedit/composition start (e.g., Japanese input)
selection-clear-on-copy only applies to copy_to_clipboard keybind action, not copy-on-select.Copy on Select
Middle-click paste always uses the selection clipboard, even when
copy-on-select = false.Selection Word Characters
How do I make semicolons part of words?
How do I make semicolons part of words?
Remove
; from the default value:Only single codepoints supported. Multi-codepoint sequences (emoji) not supported.Available since 1.3.0.
Clipboard
Clipboard Access
Clipboard Paste Protection
Clipboard Trimming
Clipboard Codepoint Mapping
Does not apply to URL copying (only text copying).Later entries override earlier ones for overlapping ranges.
Shell Integration
Auto-Injection
Shell integration enables:
- Working directory reporting (for directory inheritance)
- Prompt marking (for
jump_to_promptkeybind) - No confirmation when closing at a prompt
- Better prompt repainting on resize
Shell Integration Features
cursor
cursor
Set cursor to a bar at the prompt.
sudo
sudo
Set sudo wrapper to preserve terminfo.
title
title
Set window title via shell integration.
ssh-env
ssh-env
SSH environment variable compatibility:
- Converts
TERMfromxterm-ghosttytoxterm-256coloron remote hosts - Propagates
COLORTERM,TERM_PROGRAM,TERM_PROGRAM_VERSION
sshd_config to accept these variables.(Available since 1.2.0)ssh-terminfo
ssh-terminfo
Automatic terminfo installation on remote hosts:
- Installs Ghostty’s terminfo entry using
infocmpandtic - Requires
infocmplocally,ticon remote hosts - Automatically cached to avoid repeat installations
ghostty +ssh-cache CLI action.(Available since 1.2.0)path
path
Add Ghostty’s binary directory to
PATH. Ensures ghostty command is available even if shell init scripts reset PATH.Particularly useful on macOS where PATH is often overridden. Only added if not already present.SSH features work independently and can be combined:
- Both
ssh-env+ssh-terminfo: Usexterm-ghosttywith terminfo installation, fallback toxterm-256colorwith env vars if installation fails - Just
ssh-env: Always usexterm-256colorwith env vars - Just
ssh-terminfo: Install terminfo and usexterm-ghostty
Command Notifications (GTK)
When to Notify
GTK only. Requires shell integration or OSC 133 sequences.GTK context menu has an option to enable notifications for a single command.Available since 1.3.0.
Notification Action
bell: Terminal bell (enabled by default)notify: System notification (disabled by default)
GTK only. Available since 1.3.0.
Notification Threshold
GTK only. Available since 1.3.0.
Terminal Features
Image Storage
Limit is per screen (primary and alternate), so effective limit per surface is double.Maximum value: 4,294,967,295 (4GiB).
Title Reporting
KAM Mode
OSC Color Reporting
Working Directory
This is secondary to
window-inherit-working-directory. Inheritance takes precedence if a previous terminal exists.Typically only used for the first window.Platform defaults:
- macOS:
homeif launched from launchd oropen - Linux/GTK:
homeif launched from desktop launcher - Otherwise:
inherit
Quit Behavior
Quit After Last Window
- macOS
- Linux
Default
false matches standard macOS app behavior (app stays running).Quit Delay (Linux)
Linux only. Only has effect if
quit-after-last-window-closed = true.Minimum value: 1s.Resources
Shell Integration
Detailed shell integration guide
SSH Configuration
Using Ghostty with SSH
Keybindings
Terminal-related keybind actions
Window Settings
Window and tab configuration