Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollback, command output as temporary file #196

Closed
mitchellh opened this issue Jul 8, 2023 · 0 comments · Fixed by #200
Closed

scrollback, command output as temporary file #196

mitchellh opened this issue Jul 8, 2023 · 0 comments · Fixed by #200

Comments

@mitchellh
Copy link
Contributor

It'd be neat to have a keybinding to save the scrollback to a temporary file that is then written to the terminal. This would let someone slice and dice their scrollback as text using any old Unix commands. For example, someone could do something like: ripgrep <search> <scrollback file>.

This keybinding probably needs a config of whether to preserve or strip formatting (ANSI escape sequences).

The workflow I'm thinking is you'd hit some keybinding, say... ctrl+shift+y (making stuff up) and this would then write to a temporary file and then directly write the file path to the TTY. The temporary file would stick around forever until the system cleans it up (we can figure out a better approach later).

This could also use semantic prompts (Ghostty already supports this) to do this for specific command output, as well. That is a bit harder because we'd have to figure out a way to choose which command (last command? etc.). But the core mechanisms would be shared, just a slice vs. the full backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant