Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-3990

Mongo client line editing -- ctrl-d will not delete a single character (line length == 1)

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 2.1.0
    • Affects Version/s: 2.0.0
    • Component/s: Shell
    • Labels:
      None
    • Environment:
      Any
    • ALL

      I found this by code inspection. The linenoise.cpp file handles line editing in the mongo shell and it emulates some bash & emacs keystrokes such as ctrl-b to go back a character, ctrl-e to go to end-of-line and ctrl-d to delete the character under the cursor. ctrl-d works fine on most lines, but behaves differently on lines with zero or one characters on them. On a zero length line, it exits the program. This is deliberate and the bash shell does the same thing. On a one character line when the cursor is positioned over the single character, ctrl-d does nothing. The code has always been this way ... the code at git://github.com/antirez/linenoise.git is identical in this section. The Delete key is similar to ctrl-d but works properly and doesn't exit the program if pressed on an empty line. It will delete a single character.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: