EPFL-LAP / dynamatic

DHLS (Dynamic High-Level Synthesis) compiler based on MLIR
Other
49 stars 14 forks source link

Improve interative frontend ux with command history #83

Closed otoomey closed 3 months ago

otoomey commented 3 months ago

This is a small PR that adds the ability to traverse previously executed commands in the interactive frontend, as well as move the cursor throughout the input before executing. This saves time having to re-write misspelled commands.

This is achieved using the popular GNU readline library. Justification for using an entire additional library is that implementing command history is not entirely trivial - escape codes for the arrow keys are terminal dependent, for example. Other shell-esque tools like the Python interactive interpreter also use readline.

Alternatively, tools such as rlwrap, rlfe and the readline runtime already exist that 'wrap' io to the program to emulate these features, but they must be installed and executed separately by the user.