Skip to content

Conversation

@injust
Copy link
Contributor

@injust injust commented Jul 31, 2024

All of the other navigation keys (i.e. arrows and Home/End) have sane defaults for their respective Shift shortcuts. Page up/down should get some love too.

@niten94
Copy link
Contributor

niten94 commented Jul 31, 2024

I was testing a bit but there were terminal emulators where Shift+PageUp/PageDown is not detected in micro. I do not know what terminal emulators are usually used, but I think it is fine adding Shift+PageUp/PageDown keybindings if it can be detected in some by default.

Shift+PageUp/PageDown were detected in these terminal emulators:

  • GNOME Terminal
  • kitty
  • Xfce Terminal

The keys were not detected in these terminal emulators:

  • foot
  • QTerminal
  • rxvt
  • xterm

I have not used Alt+PageUp/PageDown much but the keys can be detected in all terminal emulators I tested. rxvt and xterm may be used a lot less than others.

@injust
Copy link
Contributor Author

injust commented Jul 31, 2024

I think foot consumes Shift+Page Up/Down to scroll history (https://codeberg.org/dnkl/foot#normal-mode).

My thought process is that the Shift modifier is conventionally used to modify a selection, i.e. when combined with the arrow keys and Home/End, as well as OS-native shortcuts to move the cursor to the previous/next word. So it's a reasonable default to have Shift work with Page Up/Down, too.

It's unfortunate that some terminal emulators don't pass Shift+Page Up/Down to micro, but IMO having a reasonable default should be higher priority than compatibility with more terminal emulators. At the end of the day, it's up to the user to rebind their keybindings (whether it's in micro or their preferred terminal emulator).

@dmaluka
Copy link
Collaborator

dmaluka commented Jul 31, 2024

but IMO having a reasonable default should be higher priority than compatibility with more terminal emulators.

I think we have no dilemma here. Adding default bindings for Shift-PageUp/Down will not break compatibility with those terminals where these bindings don't work. They will just continue not working there.

@dmaluka dmaluka merged commit 2259fd1 into zyedidia:master Jul 31, 2024
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.

4 participants