Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kAlvaro opened this issue Mar 27, 2018 · 2 comments

Comments

@kAlvaro
Copy link

kAlvaro commented Mar 27, 2018

On Windows (either CMD or PowerShell) you get extraneous output:

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

PowerShell

It comes from \splitbrain\phpcli\TableFormatter::__construct():

$width = @exec('tput cols');

When the tput command is not available the shell prints an error message on stderr and it's apparently transmitted to the shell where you run the PHP script. (Apparently bash is also subject to this but it isn't an issue because ncurses is normally installed.)

@dregad
Copy link
Contributor

dregad commented Apr 18, 2018

FWIW, this is how the getopt-php library (which does pretty much the same thing as this one) implemented terminal width detection (also using tput)

https://github.com/getopt-php/getopt-php/blob/3.1.0/src/Help.php#L298

@kAlvaro
Copy link
Author

kAlvaro commented May 10, 2018

It works fine now, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants