walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
600 stars 17 forks source link

Terminal entry not found with "tmux-256color" #21

Closed garymh closed 3 years ago

garymh commented 4 years ago

Hi! My error said to come report this:

Version: 0.9.18
LANG   : en_US.UTF-8
TERM   : tmux-256color

GOOS    : darwin
GOARCH  : amd64
Compiler: gc
NumCPU  : 16

panic: terminal entry not found [recovered]
        panic: terminal entry not found

goroutine 1 [running]:
main.main.func1()
        /Users/johan/src/moar/moar.go:88 +0x6b
panic(0x119e4c0, 0xc00009e4c0)
        /usr/local/Cellar/go/1.13.4/libexec/src/runtime/panic.go:679 +0x1b2
main._StartPaging(0xc0000cc140)
        /Users/johan/src/moar/moar.go:158 +0x183
main.main()
        /Users/johan/src/moar/moar.go:120 +0x605

Seems like theres a problem with some custom terminals...

walles commented 4 years ago

How did you get that $TERM setting?

I just tried to just start tmux on my Mac, and I got "screen" as the $TERM value, which worked fine.

So do you have any repro steps?

Regards /Johan

garymh commented 4 years ago

I'm actually setting that in my .tmux.conf file. I think it was for a workaround with italics not working in NeoVim. I believe these are the relevant lines:

set -g default-terminal "tmux-256color"
set -ga terminal-overrides ',xterm-256color:Tc'
walles commented 4 years ago

Thanks for the background @garymh!

Digging a bit this turns out to have been reported in https://github.com/gdamore/tcell/issues/245, please add yourself to that ticket.

I'm using Tcell for drawing on the terminal (it's super nice!), and when they start supporting this I will as well.

I note also (to my surprise) that less doesn't work with tmux-256color either.

nathanshelly commented 4 years ago

@walles just a heads up that at least for me less works as expected with TERM set to tmux-256color (provided the appropriate terminfo entry is installed)

walles commented 3 years ago

Dependency now moved into https://github.com/gdamore/tcell/issues/372.

After that is done, I'll upgrade my dependency and this should be solved..

walles commented 3 years ago

Now awaiting a release with tmux-256color.

Neither 1.4.0 nor 2.0.0-dev which are currently the most recent releases have it: https://github.com/gdamore/tcell/releases

walles commented 3 years ago

Not validated.

walles commented 3 years ago

@garymh, @nathanshelly, could either of you try the new 1.1 release and see if it works for you with that TERM setting?

https://github.com/walles/moar/releases/tag/1.1

nathanshelly commented 3 years ago

Can confirm v1.1 no longer crashes with TERM=tmux256-color on my machine (v1.0 also doesn't crash, didn't bother to check any other releases).

walles commented 3 years ago

Thanks for checking @nathanshelly!

And thank you for reporting @garymh!

garymh commented 3 years ago

@walles Working for me too- sorry for the late response! Thanks for the fix 😃