From 71322dfe5b327dc4b78a1894e5f4fdf4fb3257bc Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 18 Jan 2015 04:43:46 +0300 Subject: [PATCH] Use st-256color terminal for tests Reasoning: 1. vt* TERMs (used to be vt100 here) make tmux-1.9 use different and identical colors for inactive windows. This is not like tmux-1.6: foreground color is different from separator color and equal to (0, 102, 153) for some reason (separator has correct color). tmux-1.8 is fine, so are older versions (though tmux-1.6 and tmux-1.7 do not have highlighting for previously active window) and my system tmux-1.9a. 2. screen, xterm and some other non-256color terminals both have the same issue and make libvterm emit complains like `Unhandled CSI SGR 3231`. 3. screen-256color, xterm-256color and other -256color terminals make libvterm emit complains about unhandled escapes to stderr. 4. `st-256color` does not have any of the above problems, but it may be not present on the target system because it is installed with x11-terms/st and not with sys-libs/ncurses. For the given reasons decision was made: to fix tmux-1.9 tests and not make libvterm emit any data to stderr st-256color $TERM should be used, up until libvterm has its own terminfo database entry (if it ever will). To make sure that relevant terminfo entry is present on the target system it should be distributed with powerline test package. To make distribution not require modifying anything outside of powerline test directory TERMINFO variable is set. --- tests/terminfo/s/screen | Bin 0 -> 1564 bytes tests/terminfo/s/st-256color | Bin 0 -> 2324 bytes tests/test_in_vterm/test.sh | 2 ++ tests/test_in_vterm/test_tmux.py | 30 +++++++++++++++++++++++++++++- 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/terminfo/s/screen create mode 100644 tests/terminfo/s/st-256color diff --git a/tests/terminfo/s/screen b/tests/terminfo/s/screen new file mode 100644 index 0000000000000000000000000000000000000000..d380072715e77d4cd59390f4ebbcb0a0080b52c4 GIT binary patch literal 1564 zcmchXJ7`m36vzKxTKbUM7D3ToC`Gu?XS}bp3BmMXOIzER+SbxG2#M(<@1|+`ek?97 z3W_LQTwR=;1P2Fkad2>Qa1c=hCnqQIdd_!KX{b{bFFF77JCFOFd%q-KgJ?w?>X8sh z*GeouKcC&1nrzZF?LzOBiQ%Sc)7@z`ttIk>)o8k@FrUvPve7gkK|S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BXxFgGLUl>22f|s=z8$@nC_wkil zZiAtXOVWlrZMf5hJ8il7Eqa;6VAf)65V_fp+y(=Sp+PSR40m9-1H&CyZtfm(8_Zga z4I;PcE|S=~4Td%@2@Q8>xI^ZqpP(R4!k9k$fF7Nv=e-4eKvzROz*fLk+FBu7p0(0! z1;*;$Z0vz*xl{iv=6{NdRWJgfnIG1rRc`*gn^2ym#0iJ}i+yDRo literal 0 HcmV?d00001 diff --git a/tests/test_in_vterm/test.sh b/tests/test_in_vterm/test.sh index 70c7319b..447ad97d 100755 --- a/tests/test_in_vterm/test.sh +++ b/tests/test_in_vterm/test.sh @@ -14,6 +14,8 @@ ln -s "$(which env)" tests/vterm/path ln -s "$PWD/scripts/powerline-render" tests/vterm/path ln -s "$PWD/scripts/powerline-config" tests/vterm/path +cp -r tests/terminfo tests/vterm + FAIL_SUMMARY="" test_tmux() { diff --git a/tests/test_in_vterm/test_tmux.py b/tests/test_in_vterm/test_tmux.py index f4960423..eb8de65f 100755 --- a/tests/test_in_vterm/test_tmux.py +++ b/tests/test_in_vterm/test_tmux.py @@ -59,7 +59,35 @@ def main(): ], cwd=VTERM_TEST_DIR, env={ - 'TERM': 'vt100', + # Reasoning: + # 1. vt* TERMs (used to be vt100 here) make tmux-1.9 use + # different and identical colors for inactive windows. This + # is not like tmux-1.6: foreground color is different from + # separator color and equal to (0, 102, 153) for some reason + # (separator has correct color). tmux-1.8 is fine, so are + # older versions (though tmux-1.6 and tmux-1.7 do not have + # highlighting for previously active window) and my system + # tmux-1.9a. + # 2. screen, xterm and some other non-256color terminals both + # have the same issue and make libvterm emit complains like + # `Unhandled CSI SGR 3231`. + # 3. screen-256color, xterm-256color and other -256color + # terminals make libvterm emit complains about unhandled + # escapes to stderr. + # 4. `st-256color` does not have any of the above problems, but + # it may be not present on the target system because it is + # installed with x11-terms/st and not with sys-libs/ncurses. + # + # For the given reasons decision was made: to fix tmux-1.9 tests + # and not make libvterm emit any data to stderr st-256color + # $TERM should be used, up until libvterm has its own terminfo + # database entry (if it ever will). To make sure that relevant + # terminfo entry is present on the target system it should be + # distributed with powerline test package. To make distribution + # not require modifying anything outside of powerline test + # directory TERMINFO variable is set. + 'TERMINFO': os.path.join(VTERM_TEST_DIR, 'terminfo'), + 'TERM': 'st-256color', 'PATH': vterm_path, 'SHELL': os.path.join(''), 'POWERLINE_CONFIG_PATHS': os.path.abspath('powerline/config_files'),