3 ms·
How can it detect termin background color?
by iudqnolq 6y ago
How can it detect termin background color?
- jwalton 6y agoThis is the function they are using to detect the background color: https://github.com/muesli/termenv/blob/d1b90ad4a4915162648dd5d351f480f5600a2771/termenv_unix.go#L64 https://github.com/muesli/termenv/blob/d1b90ad4a4915162648dd... (There’s a different version of it for Windows.)
- de6u99er 6y agoThe windows one just returns default black, which is correct in most cases since very few change it to something else. https://github.com/muesli/termenv/blob/d1b90ad4a4915162648dd5d351f480f5600a2771/termenv_windows.go#L14 https://github.com/muesli/termenv/blob/d1b90ad4a4915162648dd...
- bradrn 6y agoThis is not entirely true: Windows Powershell defaulted to a blue background. Though this is admittedly an edge case, as Windows Powershell is now deprecated in favour of Powershell Core (which has a black background) IIRC.