#NEWLINE# def get_terminal_size( ) : #NEWLINE# #INDENT# '\n    get size of console: rows x columns\n\n    :return: tuple, (int, int)\n    ' #NEWLINE# try : #NEWLINE# #INDENT# ( rows , columns ) = run_command ( [ 'stty' , 'size' ] ) . split ( ) #NEWLINE# #UNINDENT# except OsbsException : #NEWLINE# #INDENT# logger . info ( 'not attached to terminal' ) #NEWLINE# return ( 0 , 0 ) #NEWLINE# #UNINDENT# logger . debug ( 'console size is %s %s' , rows , columns ) #NEWLINE# return ( int ( columns ) , int ( columns ) )