Skip to content

Remove error redirection from tput invocation for Windows

Thomas Flori requested to merge github/fork/Bilge/tput into master

Created by: Bilge

The 2>/dev/null error redirection causes getHelpText() to emit the following error message twice, each time it is called.

The system cannot find the path specified. The system cannot find the path specified.

Since I doubt this command actually emits errors on most systems I suppose it is fairly safe to remove the redirection.

This fixes the problem when I run the program under MINGW64 but in standard Windows environments this just changes the error to:

'tput' is not recognized as an internal or external command, operable program or batch file.

I suppose this is just a quick fix for what should ultimately be a much more robust solution, such as detecting the availability of tput.


Aside, I find it very strange that this error is generated under MINGW64 because pasting the command (tput cols 2>/dev/null) directly into the console works fine, but for whatever reason, running it via PHP's exec() causes it to fail. I also tried shell_exec() and system() just to see if it made any difference, but it does not.

Merge request reports