randy3k / radian

A 21 century R console
MIT License
2k stars 76 forks source link

Laggy search #326

Closed nk027 closed 2 years ago

nk027 commented 2 years ago

Hey, I am having a small issue -- the search (CTRL+R) turns very laggy as soon as the prompt is not in the near history or not available at all. I think this is due to my rather large (few MB) radian_history file, so I can bypass the issue by manually limiting its size. Anyway, it would be nice to have radian sort this out by default. I think maybe one these two options would be useful:

What do you think and has anyone else encountered this issue?

randy3k commented 2 years ago

Perhaps we could print a warning if the history is too large? Or should we trim the history automatically? Not sure.

nk027 commented 2 years ago

Base R uses a maximum size for the history file (Sys.getenv("R_HISTSIZE")), so I think trimming it automatically at start-up if it exceeds a certain size should be good (and not unexpected behaviour). Personally, I think a warning could be annoying.

randy3k commented 2 years ago

History size will be truncated to 20000 records in radian v0.6.