Shells (at least what I know) have really bad command editing capabilities.
- I can't point the cursor to any point of the command.
- I can't select and backspace/delete/replace text in the command.
Currently these are so distracting, I use gedit to edit commands before pasting them to the terminal.
Is there any solution that's good for these?
Bash is actually quite good at this. You just need to learn its shortcuts. For example (in the default emacs mode):
And there are many more. Read
man readlineto see what else is available. You can assign different shortcuts by placing them in
~/.inputrc. For example, to make Ctrl + Left go back one word and Ctrl + Right go forward one word, add this to your
To find out what those strange codes mean, press Ctrl + V and then press the key you would like to use. If you try with Ctrl + Right, you will see
You might also want to look into other shells. Popular "modern", feature-rich shells include: