-
-
Notifications
You must be signed in to change notification settings - Fork 678
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
Add ClearScrollback to replicate macOS Cmd+K behavior #1768
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @fcoury - thank you for your patience!
I'm happy to accept this, but would ask for a few changes:
- How about if instead of
roll_to_top
we clear the viewport and then add canonical lines to it similar to how we initialize it in the constructor (viewport: vec![Row::new(columns).canonical()]
)? I think that will make things a little clearer - Now that we've added actions through the CLI, let's add this one as well so the user has an immediate interface to it without having to configure it? Something like
zellij action soft-clear
? - Given
2
, I think we can remove the configuration option and add it as a flag to either the CLI or the bound key. - Maybe we can rename the action to
clear
?
@imsnif not a problem! I'll get right to it as soon as time permits and get back to you! Thank you! |
61efd5e
to
1e246e5
Compare
@imsnif just rebased my branch from current |
I'd love to see this as well! I would call it |
1e246e5
to
48d38c6
Compare
Hi, I just saw the #281 and the comment linking to this PR. You reference this as a soft clear, perhaps I'm confusing myself here but to my memory Either way, I'd love to be able to use |
Hey there @imsnif, finally decided to take another look at solving this. Let me tell you what I found so far:
The problem is that the current prompt is lost if we do that. Here's what the command looks like with the viewport solution you propose: Resetting viewport: ResetViewport.mp4Here we lose our current prompt. Adding canonical lines: AddCanonicalLines.mp4This way our prompt is kept as-is. Do you think there's a better way to achieve this? Thanks! |
48d38c6
to
63f36a5
Compare
@imsnif ready for review 😊 |
Hey @fcoury - thanks for this, but it has already been implemented: #2239 In the docs: https://zellij.dev/documentation/keybindings-possible-actions#clear |
Hey there, they don't seem to do the same think. This perfectly emulates what happens when you press Cmd+K on macOS. If this doesn't seem like something we want to support, can it be introduced as a plugin? If so, do you have any examples? Thank you! |
What's the difference? |
Sorry replying from my phone but will try to explain in detail with some
screencasts tomorrow.
…On Mon, 9 Oct 2023 at 04:37 Aram Drevekenin ***@***.***> wrote:
What's the difference?
—
Reply to this email directly, view it on GitHub
<#1768 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAKWZXBS7ICLCOHL4NCSDX6OSTTAVCNFSM6AAAAAAQ2UYRHGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJSGQ4DINRWGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Replicates the behavior of the
Cmd+K
command used on macOS's Terminal.app and iTerm.Screen.Recording.2022-10-01.at.08.16.02.PM.mp4
Action
The new action is called
SoftClear
but completely open to a better name.Example of its usage on a keybinding:
Feature Configuration
This PR also adds a new configuration setting
soft_clear_offset
that allows the user to specify an offset, counted from the top of the screen, of how many additional lines he/she wants to see when performing this soft clear. This overcomes a problem I face with iTerm with the same command, where it trims the first line of my prompt (see below), while retaining a sane default for most uses.Example of use:
And the issue I have today with iTerm that led me to add the new setting above:
Screen.Recording.2022-10-01.at.08.18.47.PM.mp4