RecuperaBit icon indicating copy to clipboard operation
RecuperaBit copied to clipboard

Add readline support

Open brendon-boldt opened this issue 1 year ago • 2 comments

This should add command history and some basic readline commands to the main command line prompt. I have tested this on my Linux system with CPython and Pypy (NixOS, specifically).

brendon-boldt avatar Mar 03 '24 02:03 brendon-boldt

I only see import readline but the module is not being used anywhere. Is this PR missing some commits?

Lazza avatar Mar 26 '24 09:03 Lazza

It's not a mistake, and it confused me at first too. I cannot find any documentation, but just importing the module gives you some of the nice features (for me backspace and up/down for command history) for Python's input() function. It could just be a quirk of my system, but it is pretty easy to test by running python -c 'input(); input()' and comparing it to python -c 'import readline; input(); input()' (double input() gives you a chance to check command history support).

brendon-boldt avatar Mar 26 '24 14:03 brendon-boldt