3 ms·
How can you use grep to search the scrollback/screen buffer?
by threecheese 1y ago
How can you use grep to search the scrollback/screen buffer?
- vulcan01 1y agoGhostty has a write_scrollback_file action you can use to write the scrollback to a temporary file. I have this set to cmd+shift+f, so I simply less [cmd+shift+f] [enter] You can use grep similarly.
- lytedev 1y agoI don't want to presume your use case, but Ghostty has a command for dumping the buffer to a file, which I use for processing output "too late" to use grep. keybind = ctrl+alt+shift+o=write_scrollback_file:open
- deleted 1y ago[deleted]
- godelski 1y agoTry a pager instead. Batcat is more feature rich but there's always the good old less (and more) command. Both work great with grep. I do things like the following multiple times a day $ cat foo.log | less $ cat foo.log | $PAGER $ cat foo.log | grep 09-23-2025 | less Side note / pro tip: on a new line in the terminal press control-x control-e. If you're in zsh you need to edit your config but this will work out of the box for bash.
- jdub 1y agoYou can leave the cat at home. less foo.log grep 09-25-2025 foo.log | less
- hamandcheese 1y agohttps://mrmr.io/cat https://mrmr.io/cat
- asimovDev 1y agobut he will feel lonely if he doesn't participate :(