gosu / gosu

2D game development library for Ruby and C++
https://www.libgosu.org/
Other
1.99k stars 172 forks source link

macOS: Ruby/Gosu tutorial hangs when run from tmux, no window, no output #644

Open kwstannard opened 1 year ago

kwstannard commented 1 year ago

Putting this here for future people. Gosu does not work if you run from within tmux. You have to run it from a non-tmux shell session. Replecated the issue in both Kitty and Terminal.

$ ruby -rgosu -e 'puts Gosu::VERSION'
1.4.6

$ brew search sdl2
==> Formulae
sdl2 ✔              sdl2_gfx ✔          sdl2_image ✔        sdl2_mixer ✔        sdl2_net ✔          sdl2_sound ✔        sdl2_ttf ✔`

$ DEBUG=t GOSU_DEBUG=t ruby -rgosu -e 'w = Gosu::Window.new(200, 150); w.caption="hello"; w.show'

The command hangs, no windows are created, no output. I have to kill-9 the process to stop it. 🤷

jlnr commented 1 year ago

Thanks for the report. It looks like brew install supertux tmux and then running supertux2 from within tmux works. I will leave this issue open because it seems Gosu is doing something "wrong" or maybe missing some extra code that supertux has.