dalance / termbg

A Rust library for terminal background color detection
Apache License 2.0
87 stars 8 forks source link

fix: fix direct terminal is `tmux` if run `sudo` without `-E` #28

Closed eatradish closed 1 month ago

eatradish commented 1 month ago

The TMUX environment variable is not passed with sudo (if running sudo without -E), and detecting if the value of the $TERM variable is prefixed with tmux will make it possible to detect whether or not the sudo environment is tmux .

dalance commented 1 month ago

Thank you for your contribution!

dalance commented 1 month ago

I released v0.5.2.