veganaize / HotDIR

Colorized file & folder listing for the Windows console
https://veganaize.github.io/HotDIR/
The Unlicense
15 stars 1 forks source link

Detect non-stock terminals and behave appropriately #1

Open veganaize opened 7 years ago

veganaize commented 7 years ago

Command-prompt windows, besides PowerShell and CMD.exe, should be detected.

If the terminal window supports ANSI (but not Windows console colors) then fallback to emitting ANSI color/control codes. If the console doesn't support color at all, or it can't be determined, then fallback to a no-color plain ASCII/Unicode output.

This will eliminate garbage on the display.

veganaize commented 4 years ago

• Detect pipes. • Detect MinGW/MSYS/Cygwin Bash terminal (TERM=xterm) and invoke winpty hd <...> instead, or similar. [Maybe just check if winpty is in PATH and use it, if so? --edit: Probably not a good idea just in case user has opted-in to including all git-for-windows utilities in CMD path.]