Closed krdav closed 8 years ago
Something like this will do:
try: rows, columns = [int(v) for v in check_output(['stty', 'size']).split()] # get actual tty height and width except: rows, columns = [50, 200] # Set to default if "stty size" does not return anything
yes! nice catch, thanks. I hadn't realized stty didn't port to non-login terminals. It doesn't look like you can do it portably, though, so yeah, try/except it is.
Got an error while running partis on a batch system. Don't have the actual error output because I corrected it and then ran smoothly.
This is the line that causes the error:
I just fixed the values but one could make a try/except to make it more robust.