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

Action that writes both scrollback and active screen to file. #2040

Closed
wants to merge 1 commit into from

Conversation

jcollie
Copy link
Collaborator

@jcollie jcollie commented Aug 4, 2024

Currently, you can write the scrollback to a file, write the active screen to a file, but not both. This adds an action that writes both to a file.

Currently, you can write the scrollback to a file, write the active
screen to a file, but not both. This adds an action that writes both to
a file.
@qwerasd205
Copy link
Collaborator

screen is already the entire (written) contents of the terminal.

/// Top-left is the furthest back in the scrollback history
/// supported by the screen and the bottom-right is the bottom-right
/// of the last written row. Note this last point is important: the
/// bottom right is NOT necessarilly the same as "active" because
/// "active" always allows referencing the full rows tall of the
/// screen whereas "screen" only contains written rows.
screen,

@jcollie
Copy link
Collaborator Author

jcollie commented Aug 4, 2024

Whoops! Thanks!

@jcollie jcollie closed this Aug 4, 2024
@jcollie jcollie deleted the write-all-file-action branch August 4, 2024 19:38
mitchellh added a commit that referenced this pull request Jan 22, 2025
…creen_file`) (#5285)

The current default keybinding on `Ctrl-Shift-J`/`Cmd-Shift-J` utilize
[`write_scrollback_file`](https://ghostty.org/docs/config/keybind/reference#write_scrollback_file)
which only captures text that's scrolled off-screen. This can be
confusing, as I would expect it to capture everything on and off-screen.

Per the docs,
[`write_screen_file`](https://ghostty.org/docs/config/keybind/reference#write_screen_file)
is the "Same as `write_scrollback_file` but writes the full screen
contents" which is perfect to solve this problem and aligns exactly with
the expected behavior.

This change addresses the friction that people have reported in the
discussions below and specifically coming from the [search scrollback
feature discussion](#189),
where `Ctrl-Shift-J`/`Cmd-Shift-J` is one of the interim decent
workarounds but then you also have to figure out the extra intricacy to
use `write_screen_file` instead of `write_scrollback_file`.

Previous discussions:

 - #3652
 - #3496
 - #4911
 - #4390
-
#2363 (comment)
-
#189 (comment)
 - #2040
 
### Workaround

Before this PR is merged, you can achieve the same result by updating
your Ghostty config:

`.config/ghostty`
```sh
# So we have more scrollback history (the size of the scrollback buffer in bytes)
scrollback-limit = 100000000

# The default keybindings use `write_scrollback_file` but that only includes what is
# offscreen. `write_screen_file` includes what's on screen and offscreen.
keybind = ctrl+shift+j=write_screen_file:paste
keybind = ctrl+shift+alt+j=write_screen_file:open
```
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 this pull request may close these issues.

2 participants