-
Notifications
You must be signed in to change notification settings - Fork 175
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
Improved routine for terminal dimensions. Works on windows too. #127
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@@ -32,8 +33,6 @@ | |||
except (ImportError, ModuleNotFoundError): | |||
pass | |||
|
|||
__version__ = '0.1.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as this was a legacy of terminal.py being its own package.
textfsm/terminal.py
Outdated
@@ -472,7 +461,7 @@ def main(argv=None): | |||
# Prints the size of the terminal and returns. | |||
# Mutually exclusive to the paging of text and overrides that behaviour. | |||
if opt in ('-s', '--size'): | |||
print('Length: %d, Width: %d' % TerminalSize()) | |||
print('Width: %d, Length: %d' % TerminalSize()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only user facing change.
Slight change in behaviour, unlikely to be observed by users except for a corner case where environment vars are different (for some reason?) from the terminal size itself. From https://github.com/python/cpython/blob/main/Lib/shutil.py#L1438 we see that the standard function uses the environment vars in preference to interrogating the terminal itself. The code being replaced here would only fell back to using the environment vars if the call to the terminal failed. The new behaviour is probably preferable. |
No description provided.