wavesoft / local-echo

A local-echo controller for xterm.js
Apache License 2.0
142 stars 71 forks source link

History limit removes the newest command, not the oldest #34

Open RReverser opened 4 years ago

RReverser commented 4 years ago

This:

https://github.com/wavesoft/local-echo/blob/8d0b7f55c5cf4b0b5f7c5132825dc5bd984bf017/lib/HistoryController.js#L22-L24

should've been using .shift(). Instead, current behaviour keeps pushing one item into the history and immediately popping it back, so that once limit is reached, no history items are stored.