duf
duf copied to clipboard
tmux not recognized as interactive terminal (no color)
I'm in an interactive terminal in a tmux:
$ echo $TMUX
/tmp/tmux-1000/default,16080,0
$ test -t 1 && echo stdout is a terminal
stdout is a terminal
But when I run duf
, I don't get colorized output unless I set CLICOLOR_FORCE=1
.
% duf --version
duf 0.8.1
% tmux -V
tmux 3.4
Works fine here, can you still reproduce?
If so, try posting env
output and we can see what's different.
Ah, it works fine on tmux 3.4 on Mac, but not on tmux 3.2a on Linux. The difference seems to be that with tmux 3.2a on Linux, I have TERM=screen
, but with tmux 3.4, I have TERM=screen-256color
.
~/src/duf $ tmux -V
tmux 3.2a
~/src/duf $ echo $TERM
screen
~/src/duf $ ./duf
[no color]
~/src/duf $ TERM=screen-256color ./duf
[has color]
It would probably be fine for duf to default to printing ANSI codes when TERM=screen and stdout is a terminal.