`jshell` maps `ALT+BACKSPACE` (on my Linux system) to delete _"the last word"_, and that is great. But in almost all REPLs and shells, typing `foo.bar.baz` and then `ALT+BACKSPACE` truncates the line to `foo.bar`, whereas `jshell` nukes the entire `foo.bar.baz`. The same problem happens with other delimiter characters like `(` (.e.g, `calling(a(very(nested(method`) or math operators (e.g., `1+2-3/4%5`). This really damages the REPL experience. Other REPLs (e.g., Python, Emacs) recognize and stop on these delimiters. Can we extend `jshell` delimiters to match other REPLs, please?
Note that this change of recognition of a "word" should affect following key combinations:
- Move one word forward: `ALT+F`, `CTRL+ARROW_R`
- Move one word backward: `ALT+B`, `CTRL+ARROW_L`
- Delete the word to the left of the cursor: `ALT+BACKSPACE`
- Delete the word to the right of the cursor: `CTRL+DELETE`
For reference, `rlwrap` recognizes the following list of characters as delimiter:
(){}[],'+-=&^%$#@";|\./
See `rlwrap` manual on `--break-chars` for details.
Note that this change of recognition of a "word" should affect following key combinations:
- Move one word forward: `ALT+F`, `CTRL+ARROW_R`
- Move one word backward: `ALT+B`, `CTRL+ARROW_L`
- Delete the word to the left of the cursor: `ALT+BACKSPACE`
- Delete the word to the right of the cursor: `CTRL+DELETE`
For reference, `rlwrap` recognizes the following list of characters as delimiter:
(){}[],'+-=&^%$#@";|\./
See `rlwrap` manual on `--break-chars` for details.