asciimoo / wuzz

Interactive cli tool for HTTP inspection
GNU Affero General Public License v3.0
10.56k stars 412 forks source link

termbox: unsupported terminal with tmux #129

Closed gitschneider closed 4 years ago

gitschneider commented 4 years ago

I'm using tmux with $TERM set to tmux-256color, which is the recommended setting to enable italics. Unfortunately termbox does not support this TERM and wuzz panics with the following message:

2020/05/19 09:35:31 termbox: error while reading terminfo data: termbox: unsupported terminal
panic: termbox: error while reading terminfo data: termbox: unsupported terminal

goroutine 1 [running]:
log.Panicln(0xc0000a7f38, 0x1, 0x1)
        /usr/lib/go-1.12/src/log/log.go:347 +0xac
main.main()
        github.com/asciimoo/wuzz/wuzz.go:1747 +0x1c6

A quick workaround is of course to start wuzz with a differen $TERM like

TERM=xterm-256color wuzz

or even set an alias to this. Then wuzz works without problems.

The biggest problem might be, that termbox is not maintained anymore. I don't know, whether this project wants to switch to an alternative, so a more lasting solution might be to switch the term-variable in code in case of tmux. Very hacky, but might work.

asciimoo commented 4 years ago

I'm using tmux with screen-256color TERM value, and it is fine for both wuzz and tmux and other terminal applications.

The biggest problem might be, that termbox is not maintained anymore.

That's a real issue indeed. We can fork it or switch to another dependency.

a more lasting solution might be to switch the term-variable in code in case of tmux. Very hacky, but might work.

That's also a good idea as a quick solution, could you work on it?

gitschneider commented 4 years ago

Interestingly enough I have no problems with a locally built version (master and v0.4.0). As I am not able to reproduce the error I don't think it's too good to implement this hacky workaround with altering the $TERM variable.

I'm using tmux with screen-256color TERM value, and it is fine for both wuzz and tmux and other terminal applications.

Main Problem is the lacking support for italics in screen

That's a real issue indeed. We can fork it or switch to another dependency.

Apparently gocui is also not really supported anymore. The most promising fork seems to be https://github.com/awesome-gocui/gocui/ and they even try to change the underlying terminal library (see awesome-gocui/gocui/issues/42). So IMHO it might be best to wait until they switched away from termbox, and evaluate if it might be suitable for you to switch from gocui to their fork. Nonetheless, if there are more people with the same problem I had, I might work on the quick solution.

asciimoo commented 4 years ago

Great, lets do this. Thanks for the info. =]

gitschneider commented 4 years ago

Closing this for now, if anyone else has this problem feel free to reopen.