Add keybinding for moving up/down an entire page at a time #913

Closed
opened 2026-01-30 22:09:55 +00:00 by claunia · 9 comments
Owner

Originally created by @zadjii-msft on GitHub (May 9, 2019).

Ctrl+Shift+PgUp/Dn should move an entire page at a time

Ctrl+Shift+Up/Dn Arrow should move one (N) lines at a time

Originally created by @zadjii-msft on GitHub (May 9, 2019). Ctrl+Shift+PgUp/Dn should move an entire page at a time Ctrl+Shift+Up/Dn Arrow should move one (N) lines at a time
Author
Owner

@Kapperchino commented on GitHub (May 10, 2019):

@zadjii-msft Can I be assigned this issue?
Also how do I contact you guys for help when needed?

@Kapperchino commented on GitHub (May 10, 2019): @zadjii-msft Can I be assigned this issue? Also how do I contact you guys for help when needed?
Author
Owner

@miniksa commented on GitHub (May 10, 2019):

@zadjii-msft, can you follow a similar outline to https://github.com/microsoft/Terminal/issues/576#issuecomment-491129438 to get @Kapperchino started when you see this presuming you're good with it?

@miniksa commented on GitHub (May 10, 2019): @zadjii-msft, can you follow a similar outline to https://github.com/microsoft/Terminal/issues/576#issuecomment-491129438 to get @Kapperchino started when you see this presuming you're good with it?
Author
Owner

@zadjii-msft commented on GitHub (May 10, 2019):

Absolutely!

  • I'd first take a look at how to add a new keybinding event. Take a look at #623, where someone's adding a keybinding for alt+num to go to a particular tab as reference.
  • I'd also take a look at the existing keybinding for Ctrl+Shift+pgup/dn as a reference how to scroll one line at a time. See src/cascadia/terminalapp/app.cpp for the implementation of _DoScroll.
  • I'd add another method like DoScroll, but instead of scrolling by a specified amount, only specify a direction, and have the method query the active terminal control for how tall it is, and scroll by that amount.
  • as an additional note, this involves changing the current keybindings for scroll up/down to Ctrl+Shift+Up/Dn Arrow. Those are setup in CascadiaSettings.cpp I believe.

As @miniksa mentioned, you're going to be among the first people we assign to do a feature that aren't on our direct team. It might be rough and neither we nor you know exactly what to expect. Bear with us. We're learning how to be open as much as you're learning how to work in our code.

If you need any help, please feel free to ping me on this thread. I'm happy to help.

@zadjii-msft commented on GitHub (May 10, 2019): Absolutely! * I'd first take a look at how to add a new keybinding event. Take a look at #623, where someone's adding a keybinding for alt+num to go to a particular tab as reference. * I'd also take a look at the existing keybinding for Ctrl+Shift+pgup/dn as a reference how to scroll one line at a time. See `src/cascadia/terminalapp/app.cpp` for the implementation of `_DoScroll`. * I'd add another method like `DoScroll`, but instead of scrolling by a specified amount, only specify a direction, and have the method query the active terminal control for how tall it is, and scroll by that amount. * as an additional note, this involves changing the current keybindings for scroll up/down to Ctrl+Shift+Up/Dn Arrow. Those are setup in `CascadiaSettings.cpp` I believe. As @miniksa mentioned, you're going to be among the first people we assign to do a feature that aren't on our direct team. It might be rough and neither we nor you know exactly what to expect. Bear with us. We're learning how to be open as much as you're learning how to work in our code. If you need any help, please feel free to ping me on this thread. I'm happy to help.
Author
Owner

@Kapperchino commented on GitHub (May 11, 2019):

@zadjii-msft For the height of the terminal, do I get the view height and then calculate how many lines that would be? Or is there a way to get how many lines of text the terminal has?

@Kapperchino commented on GitHub (May 11, 2019): @zadjii-msft For the height of the terminal, do I get the view height and then calculate how many lines that would be? Or is there a way to get how many lines of text the terminal has?
Author
Owner

@zadjii-msft commented on GitHub (May 12, 2019):

I think that Terminal::GetViewport().Height() would bet you the height of the terminal in rows. You might need to plumb that up through the TermControl somehow.

@zadjii-msft commented on GitHub (May 12, 2019): I think that `Terminal::GetViewport().Height()` would bet you the height of the terminal in rows. You might need to plumb that up through the `TermControl` somehow.
Author
Owner

@Kapperchino commented on GitHub (May 13, 2019):

@zadjii-msft how do I make a test for this? I did some manual testing.

@Kapperchino commented on GitHub (May 13, 2019): @zadjii-msft how do I make a test for this? I did some manual testing.
Author
Owner

@zadjii-msft commented on GitHub (May 13, 2019):

You know, I don't think we actually have any test for this particular area of the code. So I think you're probably fine making a PR without the tests for now. That's on me to add the testing infrastructure :P

@zadjii-msft commented on GitHub (May 13, 2019): You know, I don't think we actually have any test for this particular area of the code. So I think you're probably fine making a PR without the tests for now. That's on me to add the testing infrastructure :P
Author
Owner

@Kapperchino commented on GitHub (May 13, 2019):

alright, I'll be doing the pr then, thanks for your help!

@Kapperchino commented on GitHub (May 13, 2019): alright, I'll be doing the pr then, thanks for your help!
Author
Owner

@miniksa commented on GitHub (May 21, 2019):

Looks like the related PR was completed. Resolving.

@miniksa commented on GitHub (May 21, 2019): Looks like the related PR was completed. Resolving.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#913