()
| 110 | |
| 111 | |
| 112 | def get_console_width(): |
| 113 | try: |
| 114 | cols = int(os.environ['COLUMNS']) |
| 115 | except (KeyError, ValueError): |
| 116 | pass |
| 117 | else: |
| 118 | if cols >= 25: |
| 119 | return cols |
| 120 | |
| 121 | try: |
| 122 | cols = max(25, int(os.popen('stty size', 'r').read().split()[1])) |
| 123 | except Exception: |
| 124 | pass |
| 125 | else: |
| 126 | return cols |
| 127 | |
| 128 | return 100 |
| 129 | |
| 130 | |
| 131 | def shprint(command, *args, **kwargs): |