For example, if I find I miss one letter in a long command, currently I need to press ← to move the cursor, which is slow. Why can't we use mouse to put the cursor in the place we want?
sudo apt-get install emacs
Upon the install, start emacs:
Press Alt+X, and type
term and press Enter. Voila!
You have a terminal where you can change the cursor position with mouse.
If mouse click does not change the cursor (in 99% of the cases, it will, by default), then put (xterm-mouse-mode t) in your .emacs file:
echo (xterm-mouse-mode t) > ~/.emacs
The terminal itself can take mouse input. You can test this opening a text file with
nano and enabling mouse
(M-M) Mouse support enable/disable
(On my keyboard that's ESC+M.)
Then you can change the position of the cursor by clicking.
If you are asking about changing the position of cursor in the SHELL, there was a discussion in ubuntuforums mentioning gpm. There is also a duplicate of this question in stackoverflow with some alternatives proposed.
In vi mode (when the the command line behave as vi, enabled by
set -o vi) you can launch a full vi to edit the current line:
Pass in command mode with
ESC, then press
v. and in vi you should be able to use your mouse to move to the expect character.
I don't know if this kind of command exist for the emacs mode (
set -o emacs), the default one.
jupyter console --kernel bash
This will launch an new window with a versatile and powerful shell that has
- mouse cursor positioning
- text selection and editing
- so much more