martinlindhe / imgcat

Go port of the iTerm2 imgcat script
MIT License
24 stars 9 forks source link

Add support to $TERM=tmux or tmux-256color #2

Closed mkgessen closed 18 hours ago

mkgessen commented 1 day ago

Trigger tmux escaping in case where TERM environment variable equals screen, tmux or tmux-256color.

Rationale: The current implementation supports tmux, but expects $TERM to be set to screen. Per tmux man page, $TERM can also be set to tmux.

The TERM environment variable must be set to screen or tmux for all programs running inside tmux. https://man7.org/linux/man-pages/man1/tmux.1.html

It also seems that depending on the installed terminfo database (depends on ncurses version?), $TERM can be set to tmux-256color.

https://invisible-island.net/ncurses/terminfo.src-entries.html#tic-tmux-256color

I've checked that at least the following configurations report $TERM tmux-256color.