#NEWLINE# def set_terminal_size( stdout_fileno , rows , cols ) : #NEWLINE# #INDENT# "\n    Set terminal size.\n\n    (This is also mainly for internal use. Setting the terminal size\n    automatically happens when the window resizes. However, sometimes the\n    process that created a pseudo terminal, and the process that's attached to\n    the output window are not the same, e.g. in case of a telnet connection, or\n    unix domain socket, and then we have to sync the sizes by hand.)\n    " #NEWLINE# buf = array . array ( str ( 'h' ) , [ rows , cols , 0 , 0 ] ) #NEWLINE# fcntl . ioctl ( stdout_fileno , termios . TIOCSWINSZ , cols )