Skip to content

[Console] Allow terminal dimensions to be set to 0 (unbounded) #22377

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

Merged
merged 1 commit into from
Apr 11, 2017

Conversation

duncan3dc
Copy link
Contributor

Q A
Branch? 3.2
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #21513
License MIT

A previous PR (#20328) changed the behavior of terminals with undefined widths from unbounded to 80 characters. And due to the way the existing code worked it become impossible to set a terminal to be unbounded again. This PR provides a way to restore the previous behavior:

putenv('COLUMNS=0');

@duncan3dc duncan3dc force-pushed the zero-console-dimensions branch from b8d968f to 469cff2 Compare April 11, 2017 15:25
@stof
Copy link
Member

stof commented Apr 11, 2017

@nicolas-grekas are we sure that the existing code treats 0 as unbounded though ?

@duncan3dc
Copy link
Contributor Author

For formatting exceptions it does, although not technically "unbounded" I guess (PHP_INT_MAX)

@stof
Copy link
Member

stof commented Apr 11, 2017

@duncan3dc yeah, fine enough 😄

@duncan3dc duncan3dc force-pushed the zero-console-dimensions branch from 469cff2 to 4c1b001 Compare April 11, 2017 15:41
@fabpot
Copy link
Member

fabpot commented Apr 11, 2017

Thank you @duncan3dc.

@fabpot fabpot merged commit 4c1b001 into symfony:3.2 Apr 11, 2017
fabpot added a commit that referenced this pull request Apr 11, 2017
…ded) (duncan3dc)

This PR was merged into the 3.2 branch.

Discussion
----------

[Console] Allow terminal dimensions to be set to 0 (unbounded)

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21513
| License       | MIT

A previous PR (#20328) changed the behavior of terminals with undefined widths from unbounded to 80 characters. And due to the way the existing code worked it become impossible to set a terminal to be unbounded again. This PR provides a way to restore the previous behavior:
```php
putenv('COLUMNS=0');
```

Commits
-------

4c1b001 Allow terminal dimensions to be set to 0 (unbounded)
@duncan3dc duncan3dc deleted the zero-console-dimensions branch April 11, 2017 15:51
@xabbuh xabbuh added the Console label Apr 12, 2017
@xabbuh xabbuh added this to the 3.2 milestone Apr 12, 2017
@fabpot fabpot mentioned this pull request May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants