Platform-specific text input and cursor movement

I would hope for platform-specific navigation in a text input field; specifically, on Linux and MacOS, I would expect basic readline bindings to work on those platforms instead of the Windows-style (CUA) bindings.

For instance, I would expect:

  • C-a: Move to the beginning of the line.
  • C-e: Move to the end of the line.
  • C-b: Move backward one character.
  • C-f: Move forward one character.
  • C-d: Delete the character under the cursor.
  • C-p: Previous input in history.
  • C-n: Next command in history.
  • M-b: Move the cursor backward one word.
  • M-f: Move the cursor forward one word.
  • M-backspace: Cut the word before the cursor.

This is not the norm for other GUI toolkits, at least on Linux, and some of these (Ctrl+a) collide with other shortcuts which I do think are more common (“Select all”). Are these maybe console only?

I don’t know about on Linux, but on Mac this is how every text entry field works, system-wide.

I see, in that case it does make sense for MacOS. I assume this is specified somewhere.

Cocoa text system - Wikipedia is a good starting point.

1 Like