You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An error occurred when inspecting the object: #<NoMethodError: undefined method 'end_with?' for nil> #1072
Thank you. I think #1073 will fix it.
For reference, do you have any idea why winsize is [0, 0]? Terminal environment, running rails console through some command line tool etc.
I can't reproduce it with the latest Rails console.
What is the output of stty size before and after rails console?
$ stty size
????
$ rails console
> p STDIN.winsize
[0, 0] # This should be zero for this investigation
An error occurred ...
[#<Array ...
> exit
$ stty size
????
If stty size is already zero, something is already going wrong. In this case, many CUI programs (ex: less, emacs, vim) does not work properly. It is better for IRB not to raise an error though.
If STDIN.winsize is changed to zero in rails console, I think there is a library listed in your Gemfile.lock that has a bug handling winsize. Reporting it to that library will be helpful.
In any case, resizing terminal window will restore wrong winsize to the correct value.
I think something is wrong with your container launching/connecting command or its command alias.
Here is a zero winsize reproduction example. Running docker with -t option (allocating a pseudo-TTY) but STDOUT is connected to a pipe to cat, so the correct winsize is unavailable.
$ docker run --rm -it rubylang/rubyfarm | cat
root@79ddcce38253:/# stty size
0 0
root@79ddcce38253:/# ruby -e "puts(*1..100)" | less
Gets corrupt screen while scrolling up and down (if the actual winsize is not 80x24)
Also running into this issue - maybe one interesting observation:
I'm only getting the error when I access the container shell via Kubernetes Dashboard (Web UI) and not when using kubectl or other CLI based tools like k9s.
Activity
tompng commentedon Jan 23, 2025
What is the output of
p STDIN.winsize, STDOUT.winsizewhen the error occurs?vladimirtcats commentedon Jan 23, 2025
I use irb with rails 8
tompng commentedon Jan 23, 2025
Thank you. I think #1073 will fix it.
For reference, do you have any idea why winsize is
[0, 0]? Terminal environment, runningrails consolethrough some command line tool etc.vladimirtcats commentedon Jan 23, 2025
I run console in standart maOS terminal in fullscreen
tompng commentedon Jan 23, 2025
I can't reproduce it with the latest Rails console.
What is the output of
stty sizebefore and after rails console?If
stty sizeis already zero, something is already going wrong. In this case, many CUI programs (ex: less, emacs, vim) does not work properly. It is better for IRB not to raise an error though.If
STDIN.winsizeis changed to zero in rails console, I think there is a library listed in your Gemfile.lock that has a bug handling winsize. Reporting it to that library will be helpful.In any case, resizing terminal window will restore wrong winsize to the correct value.
vladimirtcats commentedon Jan 24, 2025
bundle exec rails cGemfile:
It is strange, it works good in my local envronment
but it does not work in container because
vladimirtcats commentedon Jan 24, 2025
Your patch helped, thank you!
tompng commentedon Jan 24, 2025
I think something is wrong with your container launching/connecting command or its command alias.
Here is a zero winsize reproduction example. Running docker with
-toption (allocating a pseudo-TTY) but STDOUT is connected to a pipe tocat, so the correct winsize is unavailable.vladimirtcats commentedon Jan 27, 2025
@tompng Unfortunately, I can not influence parameters of container. Could you merge your patch in master?
klausmeyer commentedon Mar 18, 2025
Also running into this issue - maybe one interesting observation:
I'm only getting the error when I access the container shell via Kubernetes Dashboard (Web UI) and not when using
kubectlor other CLI based tools likek9s.Here is the output of the
sttycommand each:Kubernetes Dashboard:
CLI:
Napolskih commentedon Apr 2, 2025
@tompng
I also encountered this problem in containers running in Kubernetes, when accessing via a web terminal.
There is no problem locally, even in containers (not in Kubernetes).
It was noticed that the problem is related to updating gems:
async-http
traces
console
It seems that the problem appears if you update the console gem above 1.29.2.
Please release fixed version.
tompng commentedon Apr 3, 2025
https://github.com/ruby/irb/releases/tag/v1.15.2 Released