Open kevin-he-01 opened 4 years ago
I will work on it
Are you still working on it?
I tried sometime ago but I couldn't find a way to do it. I'll keep trying.
I found a way to do it but it does not currently work for commands like the Python REPL, the Lua REPL or bc
The Libterm 5.1.4 update yesterday has fixed this. I checked it myself
Issue
LibTerm does not seem to support line-editing features, such as editing in the middle of a command. For example, if you have typed
echo some long string to be displayed
and realized that you want to insertvery
betweensome
andlong
to make the commandecho some very long string to be displayed
, you would have to delete all the text up tosome
and insertvery
, which is very annoying.This may be considered a bug, since the shell prompt should behave mostly like
edit
, which allows editing at any cursor position, but this is more like a feature request since one would be to detect whether the cursor position is "legal" (somewhere in the current command line and not in the shell prompthostname $
or in previous commands)The discontinued OpenTerm does support such editing feature. One can try it out by building it from source (no longer available from the App Store though). Furthermore, on a normal bash session on a computer you can use the arrow keys and insert some text in the middle assuming one have GNU
readline
enabled (by default on an interactive shell). I know iOS do not have cursor keys in its built in on screen keyboard but there are still plenty ways to change the cursor position without using an external keyboard. Moving the cursor is possible by clicking at a position in the command line or deep pressing the on screen keyboard and move your finger to move the cursor.Steps to reproduce
echo some long string to be displayed
Expected Behavior
The characters typed are inserted in the command line at the cursor position.
Actual Behavior
One can move the cursor, but typing have no effect unless the cursor is at the end of the command line.