Merge pull request #2234 from strikaco/clientheight

Adds client_height() method to Command.
This commit is contained in:
Griatch 2020-10-18 23:11:40 +02:00 committed by GitHub
commit b84f715cff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -509,6 +509,20 @@ Command {self} has no defined `func()` - showing on-command variables:
"SCREENWIDTH", {0: settings.CLIENT_DEFAULT_WIDTH}
)[0]
return settings.CLIENT_DEFAULT_WIDTH
def client_height(self):
"""
Get the client screenheight for the session using this command.
Returns:
client height (int): The height (in characters) of the client window.
"""
if self.session:
return self.session.protocol_flags.get(
"SCREENHEIGHT", {0: settings.CLIENT_DEFAULT_HEIGHT}
)[0]
return settings.CLIENT_DEFAULT_HEIGHT
def styled_table(self, *args, **kwargs):
"""