Skip to content

Commit

Permalink
bug #19724 [Console] Register terminal env variables (ogizanagi)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Console] Register terminal env variables

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19719
| License       | MIT
| Doc PR        | -

Solves #19719 by setting `COLUMNS` & `LINES` env vars when running an Application.
Those env vars are then meant to be reused when using the Process component.

~~It creates a new `Terminal::registerEnv()` method allowing to register terminal related informations into environment variables. ~~It allows getting "consistent terminal informations" across processes.~~

Unless the env vars handling is backported from the 3.2 `Terminal` class to older branches in the `Application` class, the mentioned issue can't be solved this way.

Commits
-------

926bc51 [Console] Register terminal env variables
  • Loading branch information
fabpot committed Aug 30, 2016
2 parents 816a334 + 926bc51 commit 0fd7cdb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Symfony/Component/Console/Application.php
Expand Up @@ -104,6 +104,9 @@ public function setDispatcher(EventDispatcherInterface $dispatcher)
*/
public function run(InputInterface $input = null, OutputInterface $output = null)
{
putenv('LINES='.$this->terminal->getHeight());
putenv('COLUMNS='.$this->terminal->getWidth());

if (null === $input) {
$input = new ArgvInput();
}
Expand Down

0 comments on commit 0fd7cdb

Please sign in to comment.