cantino / mcfly

Fly through your shell history. Great Scott!
MIT License
6.77k stars 176 forks source link

Keyboard inputs are not visible #247

Open ssahaxd opened 2 years ago

ssahaxd commented 2 years ago

Keyboard inputs are not visible on the terminal after interrupting a command.

image After interrupting the first command I typed this which was not visible on the terminal.

cantino commented 2 years ago

I think this has nothing to do with mcfly, but try typing reset and pressing return.

MarceloLimoriGM2dev commented 2 years ago

There's definitely something wrong. Here's a bash script that, if started with Mcfly and interrupted with Ctrl+C, will leave you with a non-moving cursor. The "reset" command is needed to bring back the cursor.

Issue doesn't happen if running the script directly without Mcfly.

#!/bin/bash
echo "Sleeping..."
sleep 10
echo "finished"

My system is bash under Linux Mint, btw.

cantino commented 2 years ago

I just tried this on zsh and bash on my Mac and it was fine. I'm not denying that there's a bug with mcfly in your environment, though. I assume the same thing does not happen if you hit tab instead of return, then run the command?

MarceloLimoriGM2dev commented 2 years ago

Pressing tab seems to cause the same issue.

I just discovered, I don't need to type the name of the script either, not even run it from Mcfly. I can just trigger Mcfly with Ctr-R, then press Esc (or tab) to exit, and then if and only if, the first thing I run is the script and I cancel it, then the issue happens. If I run something else first, then I can run the script and cancel it and no problem happens.

So to summarize:

Trigger Mcfly and exit.

1) Run script and cancel => issue. 2) Run script and not cancel => no issue. 3) Run something else and then run script and cancel => no issue.

Let me know if there's some logging info I can fetch for you and thanks for your response.

silviomarazzato commented 1 year ago

Same issue: Fedora 35 Mcfly 0.61 Tilix Bash shell

I press CTRL-R and search for the command "yarn dev --https --port=8000" then press ENTER. I interrupt the above command with CTRL-C and then I don't see output on the shell. I'm forced to type the "reset" command blindly to obtain newly the control.

cantino commented 1 year ago

Okay, so I think this is an existing issue, and a bug in Bash: https://github.com/cantino/mcfly/issues/240

What version of bash are you on? This is apparently fixed in 5.2.0(1)-alpha.

silviomarazzato commented 1 year ago

My bash version is 5.1.8. I am seeing that 5.2.0 is still in beta and has not yet been released in the repositories of my distro. Is there any workaround to this problem?

cantino commented 1 year ago

I'm not aware of any workaround unfortunately, beyond typing 'reset' when it happens. If you find one, please share it!