Re: [PATCH 1/2 v2] hv: shell: improve console to buffer history cmds
Minggui Cao
toggle quoted message
Show quoted text
-----Original Message-----[Cao, Minggui] OK, let me explain in detailed, Let me give two examples: 1. if ring buffer full is 8, now buffered index: 0, 1, 2, 3, total_buffered_cmds is 4; if up key on and on, it will go as: 3-->2-->1-->0, and then if up key again, it keeps as 0, and not change again. 2. if ring buffer is full, and buffered index order is: 4, 5, 6, 7, 0, 1, 2 ,3, and start from 3, for up keys, it will go as: 3->2->1->0->7->6->5->4, and then keeps as 4, not change again for more up keys. When I check bash, found it is not a loop, I think the reason is user-friendly: user can know when it is the end of the history buffered cmds. As the two cases, I have not found how to unify the code; if adopt the above code, it is a loop, it is fine, but not user-friendly, the user could search more time. comments. |
|