In my ghostty config I use:
scrollback-limit = 512000000
keybind = super+f=write_scrollback_file:open
It writes it to a temporary file and then opens the file in the default text editor when I hit Cmd+F.