merged branch egeloen/f-2.0-terminal-width (PR #6571)
This PR was merged into the 2.0 branch.
Commits
-------
f299bd0
[Console] Make getTerminalWith & getTerminalHeight public
Discussion
----------
[Console] Make getTerminalWith & getTerminalHeight public
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Fixes the following tickets: ~
Todo: -
License of the code: MIT
Documentation PR: ~
After demand in #6567, I open an other one on the 2.0 branch.
This commit is contained in:
commit
515769385a
@ -794,7 +794,7 @@ class Application
|
|||||||
*
|
*
|
||||||
* @return int|null
|
* @return int|null
|
||||||
*/
|
*/
|
||||||
protected function getTerminalWidth()
|
public function getTerminalWidth()
|
||||||
{
|
{
|
||||||
if (defined('PHP_WINDOWS_VERSION_BUILD') && $ansicon = getenv('ANSICON')) {
|
if (defined('PHP_WINDOWS_VERSION_BUILD') && $ansicon = getenv('ANSICON')) {
|
||||||
return preg_replace('{^(\d+)x.*$}', '$1', $ansicon);
|
return preg_replace('{^(\d+)x.*$}', '$1', $ansicon);
|
||||||
@ -810,7 +810,7 @@ class Application
|
|||||||
*
|
*
|
||||||
* @return int|null
|
* @return int|null
|
||||||
*/
|
*/
|
||||||
protected function getTerminalHeight()
|
public function getTerminalHeight()
|
||||||
{
|
{
|
||||||
if (defined('PHP_WINDOWS_VERSION_BUILD') && $ansicon = getenv('ANSICON')) {
|
if (defined('PHP_WINDOWS_VERSION_BUILD') && $ansicon = getenv('ANSICON')) {
|
||||||
return preg_replace('{^\d+x\d+ \(\d+x(\d+)\)$}', '$1', trim($ansicon));
|
return preg_replace('{^\d+x\d+ \(\d+x(\d+)\)$}', '$1', trim($ansicon));
|
||||||
|
Reference in New Issue
Block a user