Skip to content
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

LibLine: Missing GNU Shortcuts #25039

Open
RolandMarchand opened this issue Sep 24, 2024 · 3 comments
Open

LibLine: Missing GNU Shortcuts #25039

RolandMarchand opened this issue Sep 24, 2024 · 3 comments

Comments

@RolandMarchand
Copy link

RolandMarchand commented Sep 24, 2024

Some GNU Bash/Readline shortcuts are not implemented in LibLine as of the latest commit c136280.

Missing shortcuts (in order of personal usage):

  • Alt+b: Back (left) one word
  • Alt+f: Forward (right) one word
  • Alt+d: Delete the Word after the cursor
  • Alt+t: Swap current word with previous
  • Alt+u: UPPER capitalize every character from the cursor to the end of the current word
  • Alt+l: Lower the case of every character from the cursor to the end of the current word
  • Alt+c: Capitalize the character under the cursor and move to the end of the word
  • Сtrl+_: Undo
  • Ctrl+xx: Toggle between the start of line and current cursor position
  • Alt+r: Cancel the changes and put back the line as it was in the history (N/A, Shell's history is copied, not reference)

Note: I may have missed some, especially related to history, but these are the most commonly used and best documented ones.

Shell already implements many existing GNU Bash shortcuts, so I am proposing to extend the list.

I am not sure if the existing shortcuts are specifically implemented in LibLine, or in Shell, Terminal, or elsewhere. Since GNU Readline implements those shortcuts, I think LibLine should, too, if it was to have them.

Edit: this issue might be a good fit for the label "good first issue."

@nico
Copy link
Contributor

nico commented Sep 24, 2024

Pretty sure we have at least most of these? #3027 added u, l, c for example.

@RolandMarchand
Copy link
Author

Huh, that's curious. I confirm to have tested all the shortcuts listed above, and they are not implemented as of c136280. I can provide more detail about my build if requested.

@alimpfard
Copy link
Member

Here's a list of all the implemented keybinds:

  • ctrl('N')
  • ctrl('P')
  • ctrl('A')
  • ctrl('B')
  • ctrl('D')
  • ctrl('E')
  • ctrl('F')
  • ctrl('H')
  • DEL
  • ctrl('K')
  • ctrl('L')
  • ctrl('R')
  • ctrl(']')
  • Key { ctrl(']'), Key::Alt }
  • ctrl('T')
  • '\n'
  • Vector<Key> { ctrl('X'), ctrl('E') }
  • Key { '.', Key::Alt }
  • ctrl('Y')
  • Key { 'b', Key::Alt }
  • Key { 'f', Key::Alt }
  • Key { ctrl('B'), Key::Alt }
  • Key { ctrl('F'), Key::Alt }
  • Key { '\b', Key::Alt }
  • Key { 'd', Key::Alt }
  • Key { '\\', Key::Alt }
  • Key { 'c', Key::Alt }
  • Key { 'l', Key::Alt }
  • Key { 'u', Key::Alt }
  • Key { 't', Key::Alt }
  • m_termios.c_cc[VWERASE]
  • m_termios.c_cc[VKILL]
  • m_termios.c_cc[VERASE]

Of the list mentioned by the OP, these are not implemented:

  • ctrl('_')
  • Vector<Key> { ctrl('X'), ctrl('X') }
  • Key { 'r', Key::Alt }

As for Alt+{u,l,c} not working, I just tested them (on lagom) and they're fine; might be a Terminal issue if you're testing from within Serenity.

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

No branches or pull requests

3 participants