[SERVER-8417] Increase .dbshell history to 1000 lines Created: 30/Jan/13  Updated: 16/Feb/18  Resolved: 16/Oct/17

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.3.2
Fix Version/s: 3.6.0-rc1

Type: New Feature Priority: Trivial - P5
Reporter: Vincent Batts Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 18
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File mongo-historylength.diff    
Issue Links:
Related
Backwards Compatibility: Fully Compatible
Participants:
Case:

 Description   

Something like the attached (which doesn't work for me yet)

In my ~/.mongorc.js, I've tried:
historyMaxLen = "1000"
and
var historyMaxLen = 1000



 Comments   
Comment by Ramon Fernandez Marina [ 16/Feb/18 ]

Hi glajchs, glad to hear the new default is working better for you.

I don't believe there's any planned work around making this configurable, so feel free to open a new SERVER ticket if you really need this feature – and if you're interested contributing it please let us know.

Regards,
Ramón.

Comment by Scott Glajch [ 16/Feb/18 ]

Hello. Thank you for increasing the default history 1000! It's a much better default.
Tad Marshall's comment implies that some work might be done to expose configuration of this length via a MONGO_SHELL_HISTORY_LINES environment variable or something similar, and the bug is closed now, but the commit details show no indication of whether or not this work is happening.

Is this going to be planned for a future version under a different bug, is this already fixed by some other commit, or is this configuration option not planning on being added?

I just want to be able to watch said issue if there is one so we can take advantage of it, if it gets added.

Comment by Githook User [ 16/Oct/17 ]

Author:

{'email': 'mike.zraly@sophos.com', 'name': 'Mike Zraly'}

Message: SERVER-8417 Increase default max history length to 1000

Signed-off-by: Ramon Fernandez <ramon@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/0d37b00b8c83c257ed3ae40b6ed4e42ae99861f0

Comment by Tad Marshall [ 25/Jul/13 ]

I think that this is all good.

We should:

  1. Increase the default to 1000 lines
  2. Provide a way for users to select a different history size

It might be misleading to allow the setting of a shell JavaScript variable to change this, unless we wrote code to dynamically resize the history buffer (which is certainly possible). A simpler technique might be to require an environment variable like MONGO_SHELL_HISTORY_LINES or something like that so that it was clear that this had to be selected before the program is started.

Comment by Asya Kamsky [ 31/Jan/13 ]

I'd like to add that initial default being 100 is very low - regardless of how/when we add ability to customize the size, I'd like to request that default start out as 1,000 instead.

Comment by Vincent Batts [ 30/Jan/13 ]

uggh, the setting of line history just needs to be done before the shellHistoryInit();

Attached is a working patch to provide a working "historyMaxLen" variable from ~/.mongorc.js

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