Note
Darwin specific, uses pbcopy and pbpaste, try xclip on GNU/Linux
Missing Ghostty terminal (https://ghostty.org) scroll buffer search by mapping CTRL-f to search in terminal.
Assuming you use bash (might work with zsh too)
- Put the following in
~/.bashrcto handle CTRL-f and invoke a script (helper)
# Ghostty does not offer scroll search
# Use CTRF-f to search via helper script
if [ -n "${GHOSTTY_RESOURCES_DIR}" ]; then
bind -x '"\C-f": "ghostty.search"'
fiCTRL-fkey binding in Ghostty config in~/.config/ghostty/config
keybind = unconsumed:ctrl+f=write_scrollback_file:copy
- Copy the helper script as
ghostty.searchsuch that is in your PATH (mine is in~/bin)
#!/bin/sh
# Helper to open history in 'less' on CTRL-f
#
# Symlink this script to somewhere in your PATH
# Ghostty config: keybind = unconsumed:ctrl+f=write_scrollback_file:copy
# Add in ~/.bashrc: bind -x '"\C-f": "ghostty.search"'
history=$(pbpaste)
echo | pbcopy
if [ -s "${history}" ]; then
trap "rm \"${history}\"" EXIT
less -+F "${history}"
fi