mongodb/mongo — pull request #123 by tadmarshall (2011-10-14 04:22:14+00:00)
Title: SERVER-3771 -- part 2 (reissue) -- make mongo shell behave like bash

This is a reissue of my earlier fix. I'm trying to break them down into
bite-sized parts to make them easier to pull.

Remove the all-on-one-line command line editing in the shell and replace it
with something more in the style of other command lines such as bash. Allow
prompts to exceed the width of the terminal screen and allow newlines in
them. Strip all other control characters from the prompt text before
displaying it so that embedded backspaces, tabs and other controls don't
display badly or require extra code to emulate. This prevents users from
using escape sequences in their prompts to perform highlighting, for now
at least. Allow command line text to exceed the available width following
the prompt by wrapping onto other lines the way they bash does it. Make the
newline character display as a newline instead of as a linefeed or DOS OEM
character. Increase the amount of common code between Windows and non-Windows
versions and make them behave the same way. Don't refresh the Windows
command line when the shift key is pressed.