Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Types and Branching String Methods

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.

Thank You

Chris Freeman
Chris Freeman
Treehouse Moderator 68,423 Points

Feedback set to developers: Workspace bash command line editing has an text overwrite bug in emacs mode (the default), but works in set -o vi mode.

To recreate, Use ctrl-b to back over multiple words, then type text to insert. Insertion is done, but the display is overwritten. Need to hit up-arrow, down-arrow to see actual inserted text and original text.

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 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

Thanks

Hambone F
Hambone F
3,581 Points

Just FYI this is still an issue in 2020, at least if you use the "Home" key to nav back to the beginning of the line.

Any plans on fixing?

Chris Freeman
Chris Freeman
Treehouse Moderator 68,423 Points

Patrick Townley, the basic line movement commands to move to beginning of line:

  • in emacs mode, ^a (Ctrl-a)
  • in vi normal mode, 0 (zero)

The β€œhome” is not bound for command line editing. This is a standard feature.