BingLingGroup / autosub

Command-line utility to transcribe/translate from video/audio/subtitles to subtitles
GNU General Public License v2.0
1.97k stars 243 forks source link

Cannot type into the terminal after running #166

Closed 9mido closed 3 years ago

9mido commented 3 years ago

The terminal is stuck after running the autosub command and after seeing "All works done." which should probably say "All work done".

I need to close the terminal with control D to be able to use another command again. Control C does nothing.

Pressing the Enter key returns the prompt sideways instead of the normal up and down.

9mido commented 3 years ago

@BingLingGroup

https://github.com/BingLingGroup/autosub/blob/dev/autosub/cmdline_utils.py#L1606-L1610

Adding os.system('stty sane') worked.

        print(_("Speech language subtitles "
                "file created at \"{}\".").format(subtitles_file_path))

        if not args.output_files:
            os.system('stty sane')
            raise exceptions.AutosubException(_("\nAll works done."))

Whatever changes the terminal settings should include a handler to change them back.

stty echo would probably also work.

It's local echo being turned off that causes what you type to not be displayed back to you.

This happens when when a program changes the terminal settings, but doesn't change them back on exit.

BingLingGroup commented 3 years ago

Related https://github.com/BingLingGroup/autosub/issues/143#issuecomment-702344721

BingLingGroup commented 3 years ago

Commit https://github.com/BingLingGroup/autosub/commit/0d6687831e69195d31d66d503b50113a3939501f should fix this. Thanks for your issue.

9mido commented 3 years ago

@BingLingGroup Yes that change worked. You're welcome and thank you.