Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The order of .node_repl_history should be reversed #3928

Closed
Zeturic opened this issue Nov 19, 2015 · 9 comments
Closed

The order of .node_repl_history should be reversed #3928

Zeturic opened this issue Nov 19, 2015 · 9 comments
Labels
feature request Issues that request new features to be added to Node.js. repl Issues and PRs related to the REPL subsystem.

Comments

@Zeturic
Copy link

Zeturic commented Nov 19, 2015

Currently, .node_repl_history keeps the newest history at the top of the file, and the oldest at the bottom. This is contrary to essentially every other program that uses a similar history file.

.zsh_history, .bash_history, .python_history, .mysql_history, along with many others, all store the oldest at the top and newest commands at the bottom. Presumably, this is done because you can simply append to the file.

Other than node itself, the number of programs that rely on .node_repl_history having the newest at the top is very small, so it's unlikely this change would be problematic.

@mscdex mscdex added repl Issues and PRs related to the REPL subsystem. feature request Issues that request new features to be added to Node.js. labels Nov 19, 2015
@Fishrock123
Copy link
Contributor

cc @chrisdickinson?

The reason is because that is the order readline uses: [1], [2]

@zeusdeux
Copy link
Contributor

I can pick this up if it's identified as an issue that needs a fix @Fishrock123 @Vhin @chrisdickinson.

@silverwind
Copy link
Contributor

Can it even be done in a backwards-compatible way?

@Fishrock123
Copy link
Contributor

No, I think that would be semver-major. I won't object to seeing if it's reasonable for v6 though.

@zeusdeux
Copy link
Contributor

zeusdeux commented Dec 7, 2015

I have gotten the code working for this. Working on getting the tests to pass. Could use some help on 'em. Could I open a PR with incomplete code and ask for help there @Fishrock123 & @silverwind ?

@Fishrock123
Copy link
Contributor

@zeusdeux sure, go ahead. :)

zeusdeux added a commit to zeusdeux/node that referenced this issue Dec 16, 2015
@zeusdeux
Copy link
Contributor

@Fishrock123 Open here -> #4313 :)

@Trott
Copy link
Member

Trott commented Jun 8, 2016

While I wouldn't oppose the change, this does seem like an implementation detail that should not affect users. I'm going to close this issue. However, if someone feels that is a mistake, by all means, re-open or comment.

@Trott Trott closed this as completed Jun 8, 2016
@bambam2174
Copy link

Just use following command:
tail -r -n $(cat ~/.node_repl_history | wc -l) ~/.node_repl_history
Then the output is display in the right (reversed) order.
you could define an alias or make a function out of it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

No branches or pull requests

7 participants