[SERVER-4044] Ctrl-U in the shell removes different text from what bash and version 1.8.4 do Created: 09/Oct/11  Updated: 11/Jul/16  Resolved: 02/Dec/11

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Bug Priority: Minor - P4
Reporter: Tad Marshall Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

If you type some text and then use ctrl-b or left arrow to move into the middle of it and then press ctrl-u, bash and the mongo shell version 1.8.4 remove the text to the left of the cursor, leaving only the text that was to the cursor's right. In versions 1.9 and higher in the mongo shell, the entire line is erased.

MongoDB shell version: 1.8.4-rc1-pre-
> abc def // sample text, to be recalled with up-arrow
Sun Oct 9 13:33:33 SyntaxError: missing ; before statement (shell):1
> def // position the cursor on the "d" and press ctrl-u ... only "abc " is removed
Sun Oct 9 13:33:39 ReferenceError: def is not defined (shell):1
>

MongoDB shell version: 2.1.0-pre-
> abc def // same typing as above
Sun Oct 9 13:33:07 SyntaxError: missing ; before statement (shell):1
> // though the cursor is on the "d", the entire line is removed

Also, I'm using the word "removed" to not step on a separate issue of cut versus delete and kill rings. That's not this bug. We could fix this bug without addressing killed text and ctrl-y by deleting the text that bash or 1.8.4 would kill.



 Comments   
Comment by auto [ 02/Dec/11 ]

Author:

{u'login': u'', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-4044 – ctrl-U should delete only text to left of cursor

On ctrl-U in the shell, delete only the text to the left of the
cursor, not the entire line. We aren't doing cut and paste yet,
this is just deletion.
Branch: master
https://github.com/mongodb/mongo/commit/80f693ed6e49e81e02a4bb8734b245c93d458ada

Generated at Thu Feb 08 03:04:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.