Skip to content

fix: suppress tput stderr leak when TERM is not present#10167

Open
paulbalandan wants to merge 1 commit intocodeigniter4:developfrom
paulbalandan:fix-tput
Open

fix: suppress tput stderr leak when TERM is not present#10167
paulbalandan wants to merge 1 commit intocodeigniter4:developfrom
paulbalandan:fix-tput

Conversation

@paulbalandan
Copy link
Copy Markdown
Member

Description
Follow-up to #10124. When stty size fails (stdin isn't a TTY), CLI::generateDimensions() falls through to tput lines / tput cols. If the spawned process inherits an environment without TERM (common in phpunit subprocess invocations and some CI runners), tput writes tput: No value for $TERM and no -T specified to stderr — exec() only captures stdout, so the message leaks. Adding 2>/dev/null to the two tput calls suppresses the noise without changing behavior: exec() still returns the empty value and the dimensions fall back to defaults.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan added the bug Verified issues on the current code behavior or pull requests that will fix them label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants