lnav icon indicating copy to clipboard operation
lnav copied to clipboard

error: unable to open TUI reason: the TERM environment variable is set to an unknown value: alacritty

Open Drew-Daniels opened this issue 9 months ago • 8 comments

Thanks so much for making this! I used this for the first time today on MacOS with iTerm2 and it was amazing for what I was working on.

I just noticed what is an issue when using lnav within an alacritty terminal (on Debian bookworm, but I assume it happens on any OS using alacritty), where it looks like lnav is refusing to open because it doesn't recognize alacritty as a valid TERM value.

lnav version v0.12.4

Describe the bug I'm not able to use lnav to view a log file, while using alacritty

To Reproduce

  • On Debian Bookworm, install lnav using snap: sudo snap install lnav
  • Follow the instructions listed in alacritty docs to build alacritty from the source
  • Open an alacritty terminal
  • Try to open a log file, lnav config.log
  • See that you get an error message
❯ lnav config.log
✘ error: unable to open TUI
 reason: the TERM environment variable is set to an unknown value: alacritty

Drew-Daniels avatar Mar 13 '25 23:03 Drew-Daniels

You might be able to workaround by setting TERM to xterm-256color.

Sounds like the alacritty terminfo file is missing. Not sure if it's an issue with the snap build or something else.

tstack avatar Mar 13 '25 23:03 tstack

Thanks @tstack - Just wanted to confirm I was able to open lnav after setting TERM to xterm-256color like you suggested

Drew-Daniels avatar Mar 15 '25 02:03 Drew-Daniels

I am seeing same error. It was working fine but started seeing this error since a day ago.

 λ lnav
✘ error: unable to open TUI
 reason: unable to initialize notcurses Unknown error: 316
 = help: The TERM value of “xterm-256color” is not known.  Check for your terminal in https://github.com/dankamongmen/notcurses/blob/master/TERMINALS.md or use “xterm-256color”

MacOS Monterey 12.7.6 Terminal: Warp v0.2025.03.12.08.02.stable_03 lnav: Homebrewed version lnav 0.12.4

:/> env | grep -E 'term|COLORTERM'

Output:

COLORTERM=truecolor
TERM=xterm-256color

lnav works fine on iTerm2 and Mac Terminal.app.

I've posted this issue on Warp GH. Searching here found similar issue has been filed already.

Thank you.

gigaimage avatar Mar 15 '25 20:03 gigaimage

@gigaimage I was able to replicate this and it seems like the DA1 response from the terminal might've changed and it was not recognized by lnav.

tstack avatar Mar 17 '25 04:03 tstack

I'm experiencing the same problem with Rio terminal and tmux, with COLORTERM=truecolor and TERM=tmux-256color (and other combinations I've tried), on Linux.

AndydeCleyre avatar Apr 10 '25 19:04 AndydeCleyre

@AndydeCleyre

I'm experiencing the same problem with Rio terminal

Can you try a recent beta release to see if the problem persists -- https://github.com/tstack/lnav/releases/tag/v0.13.0-beta4

tstack avatar Apr 10 '25 20:04 tstack

@tstack Yes, thank you, the beta indeed does not have the problem.

AndydeCleyre avatar Apr 13 '25 17:04 AndydeCleyre

@tstack : tested 0.13 beta4 Warp term (v0.2025.04.23.08.11.stable_01). It's working now. Thank you!

gigaimage avatar Apr 30 '25 14:04 gigaimage

Sounds like things are working better now, going to close. Open a new issue if the latest releases are problematic.

tstack avatar Sep 04 '25 18:09 tstack