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

Ctrl-T in Mongo shell behavior isn't quite right

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

      Emacs and bash have a cute keystroke for transposing letters. If you type "na" when you meant "an" and you realize instantly that you have done this, you can just press ctrl-t and the two characters to the left of the cursor will trade places, correcting your typo. This is special ctrl-t behavior at the end of a line. If the cursor is at the beginning of the line, so there are no characters to its left, it does nothing. At any other position in the line, it will transpose the character to the cursor's left with the character under the cursor and then advance itself forward by one position. It you press ctrl-t repeatedly from some point in the middle of a line, this has the effect of "dragging" the character that is to the cursor's left along with it towards the end of the line.

      The Mongo shell gets most of this right with two exceptions:

      1) If the cursor is at the end of the line, the shell does nothing on ctrl-t. It should transpose the two characters to its left.

      2) When the cursor is on the last character in the line, the shell correctly transposes the last two characters but it fails to advance the cursor to the end of the line.

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

              Created:
              Updated:
              Resolved: