How to go back and re-write words on the console without substituting what have already been written beforehand.
How to go back and re-write words on the console without substituting what have already been written beforehand. I write a bunch of commands on my console and then I want to go back and fix something, but every time I go back I can not write new commands in the same line, all it does is substitute the words written beforehand by erasing them and putting in what I wrote in their place . I need to erase the whole prior command to make a new one because I can't edit. Please how can I fix this issue?
I need help because I do not want to keep erasing the string and the rest all the time when I want to edit something.
Chris FreemanTreehouse Moderator 56,648 Points
By default the command line editing has been set to
emacs style editing.
As you've noted, this is not working correctly, in that, the insert appears to overwrite characters but does not actually do so. This actual text can be seen with an
up-arrow, down-arrow to reset the current line buffer to what is actually there. (yes, a bad workaround)
Vi style editing can be set with the command
set -o vi. This mode appears to correctly if that is your preference. Cheatsheet available here