[SERVER-37759] shell should merge history on exit Created: 26/Oct/18 Updated: 06/Dec/22 Resolved: 17/Dec/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kevin Pulo | Assignee: | Backlog - Server Tooling and Methods (STM) (Inactive) |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | move-stm | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Server Tooling & Methods
|
| Sprint: | Service Arch 2018-12-03, Service Arch 2018-12-17, Service Arch 2018-12-31, Service Arch 2019-01-14, Service Arch 2019-01-28, Service Arch 2019-02-11, Service Arch 2019-02-25, Service Arch 2019-03-11, Service Arch 2019-03-25, Service Arch 2019-04-08 |
| Participants: |
| Description |
|
Currently on exit the shell outputs to the history file its entire buffer of commands. This is a problem when you have concurrent shells open, because it means that only the last shell exited wins (in terms of commands performed during these concurrent shell sessions). Much better would be if the shell tracked which commands were performed in this session, and then ensured that only those new commands are added to the end of the history file (which may have changed since the shell was started up). This is how bash works (and I expect also all other Unix shells which support command history). This is complicated by needing to ensure that the number of lines in the history file is correctly limited. Probably what is needed is to re-read the history file, skip the first N lines, and then output the following max-N lines plus the N lines from this session (unless N > max, in which case, the existing behaviour is fine).
|
| Comments |
| Comment by Robert Guo (Inactive) [ 17/Dec/20 ] |
|
We will no longer be adding new features to the old mongo shell outside of a small number of exceptions. Please consider switching to the new shell, mongosh, for general use cases. If this ticket is desired for Server development, please reopen. |
| Comment by Asya Kamsky [ 21/Dec/18 ] |
|
I'd like to add that it's more important not to lose commands than to keep the history file to its absolute limit (in my opinion) |