shared: shell: Only omit consecutive duplicate history lines.
authorMarijn Suijten <marijns95@gmail.com>
Sat, 18 Jan 2020 20:44:23 +0000 (21:44 +0100)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:48 +0000 (14:30 +0530)
commit50c32d9cecb67452ce594c1d49f2fb86849a58d4
tree50c92251fa29fd12674bcf58dade3c449a992a27
parentebd33bae60126fa804cfb6cfe7ad346070b0da1c
shared: shell: Only omit consecutive duplicate history lines.

Change rl_handler to append duplicate history, as long as it isn't
identical to the last line. It prevents consecutive duplicates while
still having an accurate overview of the most recent commands used,
mimicking most modern shells.

This addresses my only major gripe with bluetoothctl: pressing UP does
not retrieve the last typed command when it is a duplicate of something
else written (much) earlier in the history. It is especially noticeable
when needing the same command repeatedly.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/shared/shell.c