pesos / grofer

A system and resource monitoring tool written in Golang!
Apache License 2.0
352 stars 52 forks source link

[BUG] grofer fails in tmux #114

Closed anihm136 closed 3 years ago

anihm136 commented 3 years ago

Describe the bug When trying to run grofer in a tmux session, it fails with the following error -

Error: failed to initialize termui: termbox: error while reading terminfo data: termbox: unsupported terminal

To Reproduce Steps to reproduce the behavior:

  1. Start a new tmux session
  2. Run grofer
  3. See error

Expected behavior Grofer should not fail in tmux (or failure should be documented)

Desktop (please complete the following information):

Additional context The issue appears to be with the termui library. If so, we should look for a solution upstream, document the failure and maybe look for a workaround if a solution is not available

Samyak2 commented 3 years ago

It works for me, in tmux too. I use oh my tmux for my tmux config, it could be due to that.

Also, from the error it seems like an issue with the terminal which I'm assuming it infers from $TERM. echo $TERM gives screen-256color for me. Maybe try setting that manually?

Samyak2 commented 3 years ago

I think this can confirm that it's due to $TERM

❯ TERM=somerandomterminal ./grofer
zsh: can't find terminal definition for somerandomterminal
Error: failed to initialize termui: termbox: error while reading terminfo data: termbox: unsupported terminal
anihm136 commented 3 years ago

Hmmm. I haven't changed my default terminal for tmux, so it is set to tmux-256color. This appears to be an upstream issue

anihm136 commented 3 years ago

Running grofer with TERM=xterm-256color grofer works on tmux. Possible addition to docs/FAQ, since this is a common fix for all terminfo entries not supported by termui