2

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:

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
radixhound
  • 2,190
  • 2
  • 18
  • 23
  • Please don't use images for information that could be used to search or debug a problem. Forcing us to retype text only discourages those who want to help you. – the Tin Man Oct 26 '19 at 06:26
  • @theTinMan I didn't use an image for information that could be used to search or debug a problem. The images are only for illustrative purposes. Did you read the question? – radixhound Oct 30 '19 at 17:33

2 Answers2

3

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.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
radixhound
  • 2,190
  • 2
  • 18
  • 23
0

There is another workaround for this. Increase the byebug timeout

# config/puma.rb    
...
environment ENV['RACK_ENV'] || 'development'
...
if ENV['RACK_ENV'] == 'development'
  worker_timeout 3600
end