Getting scrollback in cli #9804
Replies: 2 comments 6 replies
-
|
There's a keybind action for saving the scrollback to a tmp file and pasting the filepath in the terminal. On MacOS it's bound to shift+cmd+j by default. Not sure on Linux, but Ghostty doesn't have a CLI interface to these actions yet, nor a scripting/plugin system, so the solution will have to look different from your wezterm keybind. Maybe write a shell function that takes a file path, processes the contents, and pipes the result to fzf? Then you can do |
Beta Was this translation helpful? Give feedback.
-
|
BTW, tried to implement my own suggestion using AI and it is not that trivial task after all. AI managed to do something what works unreliably so I give up for now. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have following workflow in WezTerm + fish shell: I type some command (e.g.
cat) and pressalt+/. Then from the last 100 lines I collect hashes, paths and filenames and pass that to fzf to select from and on selection I append that to my command line. (Code here https://github.com/daliusd/cfg/blob/1f157ad109281b658b3d0860fa5150d0e0731e99/.config/wezterm/wezterm.lua#L211-L328 and https://github.com/daliusd/cfg/blob/master/.config/fish/functions/wezterm-fzf-words.fish for the curious).I wonder if I can do something like that in ghostty? Ideally I would love if it were ghostty native feature, but I think it is going to be quite hard to implement. Therefore I think it should be possible to do something like that if ghostty had command line option like:
ghostty +get_scrollbackorghostty +get_screen. In that case I could bindalt+/in fish shell and do everything it. I think it might be not that complicated to add something like that. Or maybe I am missing something and something like that already exists?Beta Was this translation helpful? Give feedback.
All reactions