readline history, clear before append

read_history() appends to the global history array.
Clear before each read to prevent duplication.
This commit is contained in:
Michael Davidsaver authored and Andrew Johnson committed 2026-04-01 10:01:54 -05:00
1 parent 4dfd5c7694
commit e181517de1
1 file changed
+1
+1
View File
@@ -643,6 +643,7 @@ struct ReadlineContext {
rl_bind_key('\t', rl_complete);
compute_hist_file();
if(!hist_file.empty()) {
clear_history(); // clear as read_history() will append
if(int err = read_history(hist_file.c_str())) {
if(err!=ENOENT)
fprintf(epicsGetStderr(),