python-fire icon indicating copy to clipboard operation
python-fire copied to clipboard

Control-C on command instructions loses cursor.

Open bschroeter opened this issue 7 years ago • 4 comments

When running a script with no arguments the user is presented with a man-style page listing the available commands. The natural way to dismiss this message is to either hit "q" or "control-c". The former works fine, but the latter triggers a KeyboardInterrupt which, when returning to the shell has lost the cursor and typed text no longer appears.

I've tested this on both MacOS and Linux, the same error occurs in both terminal and iterm2.

Take the following example:

import fire

def myfunc():
    return True

if __name__ == '__main__':
    fire.Fire()

Run it with:

python test.py

Then hit control-c and try to type something in the returned shell. You'll see what I mean.

bschroeter avatar Oct 14 '19 01:10 bschroeter

when returning to the shell has lost the cursor and typed text no longer appears.

yikes, sorry about that.

If you type reset it should fix things. Marking this as a bug.

dbieber avatar Oct 15 '19 02:10 dbieber

@dbieber, thanks for the quick response. Looking forward to the fix. Cheers, B

bschroeter avatar Oct 21 '19 02:10 bschroeter

i like the version v0.1.3 type help, where it lists out all the options rather than man-style help screen. wonder if you can add a feature to choose between the 2 styles.

priyeshgpatel avatar Feb 06 '20 08:02 priyeshgpatel

Fixed by 074f4b25906b4c7bc309a64feeba8873ec5e849c

dbieber avatar Mar 06 '20 22:03 dbieber