summaryrefslogtreecommitdiffstats
path: root/pym/output.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/output.py')
-rw-r--r--pym/output.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/pym/output.py b/pym/output.py
index 6ac6da3fe..08e4d8401 100644
--- a/pym/output.py
+++ b/pym/output.py
@@ -332,6 +332,15 @@ def get_term_size():
pass
return -1, -1
+def set_term_size(lines, columns, fd):
+ """
+ Set the number of lines and columns for the tty that is connected to fd.
+ For portability, this simply calls `stty rows $lines columns $columns`.
+ """
+ from portage_exec import spawn
+ cmd = ["stty", "rows", str(lines), "columns", str(columns)]
+ spawn(cmd, env=os.environ, fd_pipes={0:fd})
+
class EOutput:
"""
Performs fancy terminal formatting for status and informational messages.