Don't scroll back down on ctrl-shift-M #23739

Closed
opened 2026-01-31 08:51:00 +00:00 by claunia · 4 comments
Owner

Originally created by @cool-RR on GitHub (Oct 22, 2025).

Originally assigned to: @carlos-zamora on GitHub.

Here's something that happens to me 10 times a day. I scroll way up using Ctrl-Shift-PgUp. I find some text I want to copy. I press Ctrl-Shift-M and bam! The shell scrolls me back all the way down to the bottom and turns on select mode. Now I gotta scroll all the way back. It really should stay exactly where it is.

Originally created by @cool-RR on GitHub (Oct 22, 2025). Originally assigned to: @carlos-zamora on GitHub. Here's something that happens to me 10 times a day. I scroll way up using Ctrl-Shift-PgUp. I find some text I want to copy. I press Ctrl-Shift-M and bam! The shell scrolls me back all the way down to the bottom and turns on select mode. Now I gotta scroll all the way back. It really should stay exactly where it is.
Author
Owner

@madhavansingh commented on GitHub (Oct 22, 2025):

Hi, I wanted to add my experience with this issue for Hacktoberfest 2025.

Mac workflow / external keyboard scenario:

  • Scroll up in the terminal using Ctrl+Shift+PgUp.
  • Press Ctrl+Shift-M to enter select mode.
  • The terminal jumps to the bottom and enters select mode, losing the scrollback position.

Expected Behavior:

  • Select mode should activate without changing the scroll position.
  • Users should remain exactly where they are in the scrollback buffer.

Impact:

  • Disrupts copy-paste workflows when reviewing older output.
  • Happens frequently during normal terminal usage (10+ times per day for me).

Workarounds (temporary):

  • Use mouse selection (Shift + drag).
  • Remap Ctrl+Shift-M to another keybinding in settings.

Additional Notes:

  • I experience this on macOS using an external keyboard.
  • Fixing this would improve workflow for users across different platforms.

Thanks!

@madhavansingh commented on GitHub (Oct 22, 2025): Hi, I wanted to add my experience with this issue for **Hacktoberfest 2025**. **Mac workflow / external keyboard scenario:** - Scroll up in the terminal using `Ctrl+Shift+PgUp`. - Press `Ctrl+Shift-M` to enter select mode. - The terminal jumps to the bottom and enters select mode, losing the scrollback position. **Expected Behavior:** - Select mode should activate without changing the scroll position. - Users should remain exactly where they are in the scrollback buffer. **Impact:** - Disrupts copy-paste workflows when reviewing older output. - Happens frequently during normal terminal usage (10+ times per day for me). **Workarounds (temporary):** - Use mouse selection (`Shift + drag`). - Remap `Ctrl+Shift-M` to another keybinding in settings. **Additional Notes:** - I experience this on macOS using an external keyboard. - Fixing this would improve workflow for users across different platforms. Thanks!
Author
Owner

@carlos-zamora commented on GitHub (Oct 22, 2025):

Thanks for filing! A little bit of background. By design, if a selection already exists, when you enter mark mode, you start at that position. From your bug report, it sounds like you're scrolling up, then entering mark mode. Since there isn't an existing selection, Terminal will scroll you back to the bottom to where the cursor is.

A workaround would be to scroll up, then make a selection with the mouse. That way, you can edit it in mark mode.

That said, that kinda defeats the point! When you enter mark mode, you want the viewport to stay in the same spot and a selection to be created. The question is, where do you expect the selection to be created within the viewport /? Any suggestions? The fix itself should be pretty easy if we can get consensus on that.

@carlos-zamora commented on GitHub (Oct 22, 2025): Thanks for filing! A little bit of background. By design, if a selection already exists, when you enter mark mode, you start at that position. From your bug report, it sounds like you're scrolling up, _then_ entering mark mode. Since there isn't an existing selection, Terminal will scroll you back to the bottom to where the cursor is. A workaround would be to scroll up, then make a selection with the mouse. That way, you can edit it in mark mode. That said, that kinda defeats the point! When you enter mark mode, you want the viewport to stay in the same spot and a selection to be created. The question is, where do you expect the selection to be created _within the viewport_ /? Any suggestions? The fix itself should be pretty easy if we can get consensus on that.
Author
Owner

@cool-RR commented on GitHub (Oct 22, 2025):

A workaround would be to scroll up, then make a selection with the mouse

A better explanation to why this defeats the point is that If I wanted to use the mouse, I wouldn't even need Ctrl-Shift-M.

I'm happy you're on board with this feature request.

the question is, where do you expect the selection to be created within the viewport /? Any suggestions? The fix itself should be pretty easy if we can get consensus on that.

I would be fine with anything from the first character to last one to a random character in between. These will all be better than the current state. But the reasonable choice would probably be the first character.

@cool-RR commented on GitHub (Oct 22, 2025): > A workaround would be to scroll up, then make a selection with the mouse A better explanation to why this defeats the point is that If I wanted to use the mouse, I wouldn't even need Ctrl-Shift-M. I'm happy you're on board with this feature request. > the question is, where do you expect the selection to be created within the viewport /? Any suggestions? The fix itself should be pretty easy if we can get consensus on that. I would be fine with anything from the first character to last one to a random character in between. These will all be better than the current state. But the reasonable choice would probably be the first character.
Author
Owner

@cool-RR commented on GitHub (Nov 11, 2025):

Thank you for implementing this!

@cool-RR commented on GitHub (Nov 11, 2025): Thank you for implementing this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23739