ctop icon indicating copy to clipboard operation
ctop copied to clipboard

Move away from termbox, tmux compatibility

Open jinnatar opened this issue 4 years ago • 3 comments

On latest 0.7.5:

%> ./ctop-0.7.5-linux-amd64 
panic: termbox: error while reading terminfo data: termbox: unsupported terminal [recovered]
        panic: termbox: error while reading terminfo data: termbox: unsupported terminal

goroutine 1 [running]:
main.panicExit()
        /home/bradley/work/bcicen/ctop/main.go:147 +0x6b
panic(0xaf0de0, 0xc0001c0e70)
        /usr/lib/go/src/runtime/panic.go:969 +0x1b9
main.main()
        /home/bradley/work/bcicen/ctop/main.go:104 +0x9a7
%> echo $TERM 
tmux-256color

The issue seems to stem from nsf/termbox-go/issues/215 which is already several years old and is not getting fixed. The project in fact is in maintenance mode: "This library is somewhat not maintained anymore. " ... " If you're looking for a Go lib that provides terminal-based user interface facilities, I've heard that gdamore/tcell is good ..."

Ergo, to fix this issue the solution is probably to move away from termbox, perhaps to tcell.

A workaround in the meanwhile is to lie in .tmux.conf and use screen termcap, but this causes other issues:

set -g default-terminal screen-256color

jinnatar avatar May 27 '21 10:05 jinnatar

Another workaround is to use an alias like:

alias ctop='TERM="${TERM/#tmux/screen}" ctop'

xbb avatar Jun 11 '21 14:06 xbb