How do I get my text / cursor back when running a byebug session with Rails and the server times out?

Viewed 282

I have a Rails (5.2.2.1) application on Ruby (2.6.2p47) with Puma as the local development server.

When I am debugging using Byebug I find that when the Puma thread times out and resets, the consecutive Byebug sessions don't display the text of the commands that I type.

My solution is to restart the Rails server which can take some time.

No text is displayed:

there is no text being displayed when I type

This seems like a pretty common issue but no one has posted the question here, so I'm adding it along with a solution that works for me:

1 Answers

I created an iTerm (on Mac OS) shortcut that sends

`stty sane`

to the terminal. (Backticks are important to send the command to the shell, not to the Byebug session).

enter image description here

If you're not using iTerm, you can just type in the command in backticks or configure whatever tool you're using to send the command.

I have a good workaround thanks to a comment on GitHub.

Related