summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-11-02 05:15:35 +0000
committerZac Medico <zmedico@gentoo.org>2007-11-02 05:15:35 +0000
commitfdaca0947ccb5a3023b9af20b69a7eb00e0437f9 (patch)
tree8f610ffcf74a2f4c301e1dad86a72f5a3092f03e
parent851d04d6a6aaccfdb79a2fae864bf001c647746e (diff)
downloadportage-fdaca0947ccb5a3023b9af20b69a7eb00e0437f9.tar.gz
portage-fdaca0947ccb5a3023b9af20b69a7eb00e0437f9.tar.bz2
portage-fdaca0947ccb5a3023b9af20b69a7eb00e0437f9.zip
If the title string is too big then xtermTitle() can
misbehave by causing the terminal to echo some of the characters and generate a "beep" sound. (trunk r8289) svn path=/main/branches/2.1.2/; revision=8363
-rw-r--r--pym/output.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pym/output.py b/pym/output.py
index 08e4d8401..f59609ee7 100644
--- a/pym/output.py
+++ b/pym/output.py
@@ -231,6 +231,11 @@ def nc_len(mystr):
def xtermTitle(mystr, raw=False):
if dotitles and "TERM" in os.environ and sys.stderr.isatty():
+ # If the title string is too big then the terminal can
+ # misbehave. Therefore, truncate it if it's too big.
+ max_len = 253
+ if len(mystr) > max_len:
+ mystr = mystr[:max_len]
myt=os.environ["TERM"]
legal_terms = ["xterm","Eterm","aterm","rxvt","screen","kterm","rxvt-unicode","gnome"]
for term in legal_terms: