You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The order of .node_repl_history should be reversed #3928
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.
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 ?
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.
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
Activity
Fishrock123 commentedon Nov 20, 2015
cc @chrisdickinson?
The reason is because that is the order
readlineuses: [1], [2]zeusdeux commentedon Nov 25, 2015
I can pick this up if it's identified as an issue that needs a fix @Fishrock123 @Vhin @chrisdickinson.
silverwind commentedon Nov 27, 2015
Can it even be done in a backwards-compatible way?
Fishrock123 commentedon Nov 30, 2015
No, I think that would be semver-major. I won't object to seeing if it's reasonable for v6 though.
zeusdeux commentedon 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 commentedon Dec 11, 2015
@zeusdeux sure, go ahead. :)
repl: Reverses order of .node_repl_history
zeusdeux commentedon Dec 16, 2015
@Fishrock123 Open here -> #4313 :)
Trott commentedon 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.
bambam2174 commentedon Aug 30, 2018
Just use following command:
tail -r -n $(cat ~/.node_repl_history | wc -l) ~/.node_repl_historyThen the output is display in the right (reversed) order.
you could define an alias or make a function out of it