jupyterlite / cockle

In-browser bash-like shell implemented in TypeScript.
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Support command-line editing #35

Closed ianthomas23 closed 3 months ago

ianthomas23 commented 3 months ago

This adds support for editing within the input command line:

  1. Left and right arrows to move cursor one character at a time.
  2. Insert new character at cursor position rather that always at the end.
  3. Delete at cursor position to accompany backspace which is already implemented.
  4. Home and End to move cursor to start and end of command line.
  5. Shift/alt left and right arrows to move back and forward a word (separated by whitespace) at a time.
  6. Tab completion at the cursor location whilst keeping the remainder of the command line.

I have been a bit permissive about what keystrokes correspond to these, to ensure that this works on both of my test machines (linux and macos). In time we may need to tighten this up and make some OS-specific. This will need multi-platform testing, both manual and automated.