ggerganov / imtui

ImTui: Immediate Mode Text-based User Interface C++ Library
https://imtui.ggerganov.com
MIT License
2.94k stars 123 forks source link

No display on tmux #10

Closed toyboot4e closed 3 years ago

toyboot4e commented 4 years ago

It might be more like an issue of tmux. Both hnterm and imtui-example-ncurses0 worked well in my terminal, but when I run them using tmux, I didn't see anything.

That happened on macOS Catalina with any kind of terminal. I used default .tmux.conf.

ggerganov commented 4 years ago

I can confirm that on Ubuntu, hnterm does not render anything when using tmux. Probably something to do with tmux + ncurses compatibility.

jcalabro commented 3 years ago

Hiya! I ran in to the same issue.

I think you're going to want to check to see what your $TERM environment variable is set to within tmux. I suspect that your current $TERM value is just set to screen in your tmux session?

If so, you're going to want to make sure that outside tmux on on macos, you are using:

# not in tmux
$ echo $TERM
xterm-256color

and start new tmux sessions with tmux -2, which will give you:

# in tmux
$ echo $TERM
screen-256color

Which enables us to run the demos.

I've got an alias tmux="tmux -2" for convenience.

toyboot4e commented 3 years ago

Thank you, good to know that! I tried echo $TERM without that alias:

$ # in tmux
$ echo $TERM
xterm-24bit
$ # wow

I remember enabling true color support in my terminal (for Emacs) -- but I'm not sure if it was after opening this issue. Now I just run hnterm and it's working nicely in any terminal!

@ggerganov Feel free to close this issue!

ggerganov commented 3 years ago

I can confirm that after setting TERM=screen-256color it now also works in my Ubuntu environment.