Keybinding Action Reference
Reference of all Ghostty keybinding actions.
This is a reference of all Ghostty keybinding actions.
Ignore this key combination, don't send it to the child process, just black hole it.
This action is used to flag that the binding should be removed from
the set. This should never exist in an active set and set.put
has an
assertion to verify this.
Send a CSI sequence. The value should be the CSI sequence without the
CSI header (ESC [
or \x1b[
).
Send an ESC
sequence.
Send the given text. Uses Zig string literal syntax. This is currently not validated. If the text is invalid (i.e. contains an invalid escape sequence), the error will currently only show up in logs.
Send data to the pty depending on whether cursor key mode is enabled
(application
) or disabled (normal
).
Reset the terminal. This can fix a lot of issues when a running program puts the terminal into a broken state. This is equivalent to when you type "reset" and press enter.
If you do this while in a TUI program such as vim, this may break the program. If you do this while in a shell, you may have to press enter after to get a new prompt.
Copy and paste.
Copy the URL under the cursor to the clipboard. If there is no URL under the cursor, this does nothing.
Increase/decrease the font size by a certain amount.
Reset the font size to the original configured size.
Clear the screen. This also clears all scrollback.
Select all text on the screen.
Scroll the screen varying amounts.
Adjust the current selection in a given direction. Does nothing if no selection exists.
Arguments:
- left, right, up, down, page_up, page_down, home, end, beginning_of_line, end_of_line
Example: Extend selection to the right keybind = shift+right=adjust_selection:right
Jump the viewport forward or back by prompt. Positive number is the number of prompts to jump forward, negative is backwards.
Write the entire scrollback into a temporary file. The action determines what to do with the filepath. Valid values are:
- "paste": Paste the file path into the terminal.
- "open": Open the file in the default OS editor for text files.
The default OS editor is determined by using
open
on macOS andxdg-open
on Linux.
Same as write_scrollback_file but writes the full screen contents. See write_scrollback_file for available values.
Same as write_scrollback_file but writes the selected text. If there is no selected text this does nothing (it doesn't even create an empty file). See write_scrollback_file for available values.
Open a new window. If the application isn't currently focused, this will bring it to the front.
Open a new tab.
Go to the previous tab.
Go to the next tab.
Go to the last tab (the one with the highest index)
Go to the tab with the specific number, 1-indexed. If the tab number is higher than the number of tabs, this will go to the last tab.
Moves a tab by a relative offset.
Adjusts the tab position based on offset
. For example move_tab:-1
for left, move_tab:1
for right.
If the new position is out of bounds, it wraps around cyclically within the tab range.
Toggle the tab overview. This only works with libadwaita enabled currently.
Create a new split in the given direction.
Arguments:
- right, down, left, up, auto (splits along the larger direction)
Example: Create split on the right keybind = cmd+shift+d=new_split:right
Focus on a split in a given direction. For example goto_split:up
.
Valid values are left, right, up, down, previous and next.
zoom/unzoom the current split.
Resize the current split in a given direction.
Arguments:
- up, down, left, right
- the number of pixels to resize the split by
Example: Move divider up 10 pixels keybind = cmd+shift+up=resize_split:up,10
Equalize all splits in the current window
Control the terminal inspector visibility.
Arguments:
- toggle, show, hide
Example: Toggle inspector visibility keybind = cmd+i=inspector:toggle
Open the configuration file in the default OS editor. If your default OS editor isn't configured then this will fail. Currently, any failures to open the configuration will show up only in the logs.
Reload the configuration. The exact meaning depends on the app runtime in use but this usually involves re-reading the configuration file and applying any changes. Note that not all changes can be applied at runtime.
Close the current "surface", whether that is a window, tab, split, etc. This only closes ONE surface. This will trigger close confirmation as configured.
Close the current tab, regardless of how many splits there may be. This will trigger close confirmation as configured.
Close the window, regardless of how many tabs or splits there may be. This will trigger close confirmation as configured.
Close all windows. This will trigger close confirmation as configured. This only works for macOS currently.
Toggle maximized window state. This only works on Linux.
Toggle fullscreen mode of window.
Toggle window decorations on and off. This only works on Linux.
Toggle secure input mode on or off. This is used to prevent apps that monitor input from seeing what you type. This is useful for entering passwords or other sensitive information.
This applies to the entire application, not just the focused terminal. You must toggle it off to disable it, or quit Ghostty.
This only works on macOS, since this is a system API on macOS.
Toggle the "quick" terminal. The quick terminal is a terminal that appears on demand from a keybinding, often sliding in from a screen edge such as the top. This is useful for quick access to a terminal without having to open a new window or tab.
When the quick terminal loses focus, it disappears. The terminal state is preserved between appearances, so you can always press the keybinding to bring it back up.
To enable the quick terminal globally so that Ghostty doesn't
have to be focused, prefix your keybind with global
. Example:
keybind = global:cmd+grave_accent=toggle_quick_terminal
The quick terminal has some limitations:
- It is a singleton; only one instance can exist at a time.
- It does not support tabs, but it does support splits.
- It will not be restored when the application is restarted (for systems that support window restoration).
- It supports fullscreen, but fullscreen will always be a non-native fullscreen (macos-non-native-fullscreen = true). This only applies to the quick terminal window. This is a requirement due to how the quick terminal is rendered.
See the various configurations for the quick terminal in the configuration file to customize its behavior.
This currently only works on macOS.
Show/hide all windows. If all windows become shown, we also ensure Ghostty becomes focused. When hiding all windows, focus is yielded to the next application as determined by the OS.
Note: When the focused surface is fullscreen, this method does nothing.
This currently only works on macOS.
Quit ghostty.
Crash ghostty in the desired thread for the focused surface.
WARNING: This is a hard crash (panic) and data can be lost.
The purpose of this action is to test crash handling. For some users, it may be useful to test crash reporting functionality in order to determine if it all works as expected.
The value determines the crash location:
- "main" - crash on the main (GUI) thread.
- "io" - crash on the IO thread for the focused surface.
- "render" - crash on the render thread for the focused surface.
ignore
unbind
csi
esc
text
cursor_key
reset
copy_to_clipboard
paste_from_clipboard
paste_from_selection
copy_url_to_clipboard
increase_font_size
decrease_font_size
reset_font_size
clear_screen
select_all
scroll_to_top
scroll_to_bottom
scroll_page_up
scroll_page_down
scroll_page_fractional
scroll_page_lines
adjust_selection
jump_to_prompt
write_scrollback_file
write_screen_file
write_selection_file
new_window
new_tab
previous_tab
next_tab
last_tab
goto_tab
move_tab
toggle_tab_overview
new_split
goto_split
toggle_split_zoom
resize_split
equalize_splits
inspector
open_config
reload_config
close_surface
close_tab
close_window
close_all_windows
toggle_maximize
toggle_fullscreen
toggle_window_decorations
toggle_secure_input
toggle_quick_terminal
toggle_visibility
quit
crash