Lazza / RecuperaBit

A tool for forensic file system reconstruction.
GNU General Public License v3.0
517 stars 73 forks source link

Add readline support #122

Open brendon-boldt opened 4 months ago

brendon-boldt commented 4 months ago

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).

Lazza commented 3 months ago

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

brendon-boldt commented 3 months ago

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).