nsf / termbox-go

Pure Go termbox implementation

Home Page:http://godoc.org/github.com/nsf/termbox-go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tmux-256color $TERM unsupported

doronbehar opened this issue · comments

I use Lf which depends on termbox. I set in my .tmux.conf the following:

set -g default-terminal tmux-256color

Using Rxvt-unicode and tmux inside it, get this error when starting lf:

2019/10/06 16:34:09 initializing termbox: termbox: error while reading terminfo data: termbox: unsupported terminal

If I use a different terminal emulator (say, Alacritty), I don't get this error.

If I use the following in my .tmux.conf:

set -g default-terminal screen-256color

In either urxvt / alacritty, I don't get that error from lf.

To summarize, only the combination of:

  • urxvt
  • tmux
  • $TERM=tmux-256color (because of set -f terminal-default tmux-256color in .tmux.conf)

Causes the error.

I wouldn't mind that much if italics would have worked with tmux inside urxvt when using screen-256color $TERM/`default-terminal. Sfee this FAQ: https://github.com/tmux/tmux/blob/2.1/FAQ#L355-L383

Running env TERM=screen-256color lfdoesn't raise the error but any inner child process of lf reads TERM=screen-256color in it's environment. This means that this env wrapping wouldn't be much helpful because I often use Lf to browse files and edit them, expecting to see italics.

Would solving this be easy by just adding an entry here:

termbox-go/terminfo.go

Lines 113 to 126 in 5a49b82

compat_table := []struct {
partial string
keys []string
funcs []string
}{
{"xterm", xterm_keys, xterm_funcs},
{"rxvt", rxvt_unicode_keys, rxvt_unicode_funcs},
{"linux", linux_keys, linux_funcs},
{"Eterm", eterm_keys, eterm_funcs},
{"screen", screen_keys, screen_funcs},
// let's assume that 'cygwin' is xterm compatible
{"cygwin", xterm_keys, xterm_funcs},
{"st", xterm_keys, xterm_funcs},
}

?