summarylogtreecommitdiffstats
path: root/0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch')
-rw-r--r--0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch b/0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch
new file mode 100644
index 00000000000..aca12255182
--- /dev/null
+++ b/0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch
@@ -0,0 +1,30 @@
+From 9e291735c8e89879451c2feebda8f851dfa6e32c Mon Sep 17 00:00:00 2001
+From: Daniel Albers <daniel@lbe.rs>
+Date: Tue, 9 Dec 2014 17:47:50 +0100
+Subject: [PATCH] Fix column spacing with xterm reset escape sequence
+
+Change _re to also match \E(B\E[m as defined by terminfo for xterm:
+
+$ TERM=xterm tput sgr0 | od -xa
+0000000 281b 1b42 6d5b
+ esc ( B esc [ m
+---
+ prettytable.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/prettytable.py b/prettytable.py
+index a619659..3f6fb99 100644
+--- a/prettytable.py
++++ b/prettytable.py
+@@ -73,7 +73,7 @@ MSWORD_FRIENDLY = 11
+ PLAIN_COLUMNS = 12
+ RANDOM = 20
+
+-_re = re.compile("\033\[[0-9;]*m")
++_re = re.compile("\033(\[[0-9;]*m|\(B)")
+
+ def _get_size(text):
+ lines = text.split("\n")
+--
+2.2.0.rc0.207.ga3a616c
+