[SERVER-3990] Mongo client line editing -- ctrl-d will not delete a single character (line length == 1) Created: 01/Oct/11 Updated: 11/Jul/16 Resolved: 01/Nov/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 2.0.0 |
| Fix Version/s: | 2.1.0 |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | Tad Marshall | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Any |
||
| Operating System: | ALL |
| Participants: |
| Description |
|
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. |
| Comments |
| Comment by auto [ 01/Nov/11 ] |
|
Author: {u'login': u'erh', u'name': u'Eliot', u'email': u'eliot@10gen.com'}Message: Merge pull request #121 from tadmarshall/
|
| Comment by auto [ 01/Nov/11 ] |
|
Author: {u'login': u'erh', u'name': u'Eliot', u'email': u'eliot@10gen.com'}Message: Merge pull request #121 from tadmarshall/
|
| Comment by Tad Marshall [ 13/Oct/11 ] |
|
I closed pull request 99 and opened https://github.com/mongodb/mongo/pull/117 to replace it. |
| Comment by Tad Marshall [ 06/Oct/11 ] |
|
Pull request https://github.com/mongodb/mongo/pull/99 addresses this. |
| Comment by Tad Marshall [ 06/Oct/11 ] |
|
The bug title and description are incomplete. Ctrl-D will not delete the last character from an input line, regardless of length. |