From 524fc317add9e10278a65d04ffeeb236dd7cedca Mon Sep 17 00:00:00 2001 From: Foo Date: Sat, 23 May 2015 15:09:33 +0300 Subject: [PATCH 1/4] Parse all numbers as numbers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Typo prevented integers starting with 2 in affected places (command-line --renderer-arg parsing and POWERLINE_…_OVERRIDES parsing) from being parsed as integers. --- powerline/lib/overrides.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerline/lib/overrides.py b/powerline/lib/overrides.py index cf0ac7b1..3257d983 100644 --- a/powerline/lib/overrides.py +++ b/powerline/lib/overrides.py @@ -25,7 +25,7 @@ def parse_value(s): ''' if not s: return REMOVE_THIS_KEY - elif s[0] in '"{[0193456789-' or s in ('null', 'true', 'false'): + elif s[0] in '"{[0123456789-' or s in ('null', 'true', 'false'): return json.loads(s) else: return s From fe3b3b159822d407f305a098b8df23a9e3630299 Mon Sep 17 00:00:00 2001 From: Foo Date: Sat, 23 May 2015 15:12:43 +0300 Subject: [PATCH 2/4] Automatically truncate tmux status line when needed Closes #1328 (but not fixes it) Closes #137 (not actually fixes it because I do not know some segment widths) --- powerline/bindings/tmux/powerline-base.conf | 4 ++-- powerline/bindings/tmux/powerline_tmux_1.8_plus.conf | 2 +- powerline/renderers/tmux.py | 7 +++++++ tests/test_in_vterm/test.sh | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/powerline/bindings/tmux/powerline-base.conf b/powerline/bindings/tmux/powerline-base.conf index b7d283fb..2ec1e4d8 100644 --- a/powerline/bindings/tmux/powerline-base.conf +++ b/powerline/bindings/tmux/powerline-base.conf @@ -2,11 +2,11 @@ set -g status on set -g status-utf8 on set -g status-interval 2 set -g status-left-length 20 -set -g status-right '#(env "$POWERLINE_COMMAND" $POWERLINE_COMMAND_ARGS tmux right -R pane_id=`tmux display -p "#D"`)' +set -g status-right '#(env "$POWERLINE_COMMAND" $POWERLINE_COMMAND_ARGS tmux right -R pane_id=`tmux display -p "#D"` --width=`tmux display -p "#{client_width}"` -R width_adjust=`tmux show-options -g status-left-length | cut -d" " -f 2`)' set -g status-right-length 150 set -g window-status-format "#[$_POWERLINE_WINDOW_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER_SPACES#I #[$_POWERLINE_WINDOW_DIVIDER_COLOR]$_POWERLINE_LEFT_SOFT_DIVIDER#[default]#W $_POWERLINE_LEFT_HARD_DIVIDER_SPACES" set -g window-status-current-format "#[$_POWERLINE_WINDOW_CURRENT_HARD_DIVIDER_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER#[$_POWERLINE_WINDOW_CURRENT_COLOR]#I $_POWERLINE_LEFT_SOFT_DIVIDER#[$_POWERLINE_WINDOW_NAME_COLOR]#W #[$_POWERLINE_WINDOW_CURRENT_HARD_DIVIDER_NEXT_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER" # Legacy status-left definition to be overwritten for tmux Versions 1.8+ -set -g status-left "#[$_POWERLINE_SESSION_COLOR] #S #[$_POWERLINE_SESSION_HARD_DIVIDER_NEXT_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER#(env \"\$POWERLINE_COMMAND\" tmux left)" +set -g status-left "#[$_POWERLINE_SESSION_COLOR] #S #[$_POWERLINE_SESSION_HARD_DIVIDER_NEXT_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER#(env \"\$POWERLINE_COMMAND\" tmux left --width=`tmux display -p '#{client_width}'` -R width_adjust=`tmux show-options -g status-right-length | cut -d' ' -f2` -R pane_id=`tmux display -p '#D'`)" # vim: ft=tmux diff --git a/powerline/bindings/tmux/powerline_tmux_1.8_plus.conf b/powerline/bindings/tmux/powerline_tmux_1.8_plus.conf index 7d694e8a..f8f8a517 100644 --- a/powerline/bindings/tmux/powerline_tmux_1.8_plus.conf +++ b/powerline/bindings/tmux/powerline_tmux_1.8_plus.conf @@ -1,5 +1,5 @@ # powerline_tmux_1.8_plus.conf # tmux Version 1.8 introduces the 'client_prefix' format variable, applicable # for versions 1.8+ -set -qg status-left "#{?client_prefix,#[fg=$_POWERLINE_SESSION_PREFIX_FG]#[bg=$_POWERLINE_SESSION_PREFIX_BG]#[$_POWERLINE_SESSION_PREFIX_ATTR],#[fg=$_POWERLINE_SESSION_FG]#[bg=$_POWERLINE_SESSION_BG]#[$_POWERLINE_SESSION_ATTR]} #S #{?client_prefix,#[fg=$_POWERLINE_SESSION_PREFIX_BG],#[fg=$_POWERLINE_SESSION_BG]}#[bg=$_POWERLINE_BACKGROUND_BG]#[nobold]$_POWERLINE_LEFT_HARD_DIVIDER#(env \$POWERLINE_COMMAND \$POWERLINE_COMMAND_ARGS tmux left)" +set -qg status-left "#{?client_prefix,#[fg=$_POWERLINE_SESSION_PREFIX_FG]#[bg=$_POWERLINE_SESSION_PREFIX_BG]#[$_POWERLINE_SESSION_PREFIX_ATTR],#[fg=$_POWERLINE_SESSION_FG]#[bg=$_POWERLINE_SESSION_BG]#[$_POWERLINE_SESSION_ATTR]} #S #{?client_prefix,#[fg=$_POWERLINE_SESSION_PREFIX_BG],#[fg=$_POWERLINE_SESSION_BG]}#[bg=$_POWERLINE_BACKGROUND_BG]#[nobold]$_POWERLINE_LEFT_HARD_DIVIDER#(env \$POWERLINE_COMMAND \$POWERLINE_COMMAND_ARGS tmux left --width=`tmux display -p '#{client_width}'` -R width_adjust=`tmux show-options -g status-right-length | cut -d' ' -f2` -R pane_id=`tmux display -p '#D'`)" # vim: ft=tmux diff --git a/powerline/renderers/tmux.py b/powerline/renderers/tmux.py index ef832877..9034999a 100644 --- a/powerline/renderers/tmux.py +++ b/powerline/renderers/tmux.py @@ -31,6 +31,13 @@ class TmuxRenderer(Renderer): character_translations = Renderer.character_translations.copy() character_translations[ord('#')] = '##[]' + def render(self, width=None, segment_info={}, **kwargs): + if width and segment_info: + width -= segment_info.get('width_adjust', 0) + if width < 10: + width = 10 + return super(TmuxRenderer, self).render(width=width, segment_info=segment_info, **kwargs) + def hlstyle(self, fg=None, bg=None, attrs=None): '''Highlight a segment.''' # We don’t need to explicitly reset attributes, so skip those calls diff --git a/tests/test_in_vterm/test.sh b/tests/test_in_vterm/test.sh index 8cb61545..f87201fe 100755 --- a/tests/test_in_vterm/test.sh +++ b/tests/test_in_vterm/test.sh @@ -11,6 +11,7 @@ mkdir tests/vterm/path ln -s "$(which "${PYTHON}")" tests/vterm/path/python ln -s "$(which bash)" tests/vterm/path ln -s "$(which env)" tests/vterm/path +ln -s "$(which cut)" tests/vterm/path ln -s "$PWD/scripts/powerline-render" tests/vterm/path ln -s "$PWD/scripts/powerline-config" tests/vterm/path From 37b0af8f74e76d40e6d8eb61adc9f3f4700dbeae Mon Sep 17 00:00:00 2001 From: Foo Date: Sat, 23 May 2015 16:06:51 +0300 Subject: [PATCH 3/4] Disable segment truncation on tmux-1.6 --- powerline/bindings/tmux/powerline-base.conf | 4 ++-- powerline/bindings/tmux/powerline_tmux_1.7_plus.conf | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 powerline/bindings/tmux/powerline_tmux_1.7_plus.conf diff --git a/powerline/bindings/tmux/powerline-base.conf b/powerline/bindings/tmux/powerline-base.conf index 2ec1e4d8..5900f9b4 100644 --- a/powerline/bindings/tmux/powerline-base.conf +++ b/powerline/bindings/tmux/powerline-base.conf @@ -2,11 +2,11 @@ set -g status on set -g status-utf8 on set -g status-interval 2 set -g status-left-length 20 -set -g status-right '#(env "$POWERLINE_COMMAND" $POWERLINE_COMMAND_ARGS tmux right -R pane_id=`tmux display -p "#D"` --width=`tmux display -p "#{client_width}"` -R width_adjust=`tmux show-options -g status-left-length | cut -d" " -f 2`)' +set -g status-right '#(env "$POWERLINE_COMMAND" $POWERLINE_COMMAND_ARGS tmux right -R pane_id=`tmux display -p "#D"`)' set -g status-right-length 150 set -g window-status-format "#[$_POWERLINE_WINDOW_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER_SPACES#I #[$_POWERLINE_WINDOW_DIVIDER_COLOR]$_POWERLINE_LEFT_SOFT_DIVIDER#[default]#W $_POWERLINE_LEFT_HARD_DIVIDER_SPACES" set -g window-status-current-format "#[$_POWERLINE_WINDOW_CURRENT_HARD_DIVIDER_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER#[$_POWERLINE_WINDOW_CURRENT_COLOR]#I $_POWERLINE_LEFT_SOFT_DIVIDER#[$_POWERLINE_WINDOW_NAME_COLOR]#W #[$_POWERLINE_WINDOW_CURRENT_HARD_DIVIDER_NEXT_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER" # Legacy status-left definition to be overwritten for tmux Versions 1.8+ -set -g status-left "#[$_POWERLINE_SESSION_COLOR] #S #[$_POWERLINE_SESSION_HARD_DIVIDER_NEXT_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER#(env \"\$POWERLINE_COMMAND\" tmux left --width=`tmux display -p '#{client_width}'` -R width_adjust=`tmux show-options -g status-right-length | cut -d' ' -f2` -R pane_id=`tmux display -p '#D'`)" +set -g status-left "#[$_POWERLINE_SESSION_COLOR] #S #[$_POWERLINE_SESSION_HARD_DIVIDER_NEXT_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER#(env \"\$POWERLINE_COMMAND\" tmux left -R pane_id=`tmux display -p '#D'`)" # vim: ft=tmux diff --git a/powerline/bindings/tmux/powerline_tmux_1.7_plus.conf b/powerline/bindings/tmux/powerline_tmux_1.7_plus.conf new file mode 100644 index 00000000..6562b6a7 --- /dev/null +++ b/powerline/bindings/tmux/powerline_tmux_1.7_plus.conf @@ -0,0 +1,3 @@ +set -g status-right '#(env "$POWERLINE_COMMAND" $POWERLINE_COMMAND_ARGS tmux right -R pane_id=`tmux display -p "#D"` --width=`tmux display -p "#{client_width}"` -R width_adjust=`tmux show-options -g status-left-length | cut -d" " -f 2`)' +set -g status-left "#[$_POWERLINE_SESSION_COLOR] #S #[$_POWERLINE_SESSION_HARD_DIVIDER_NEXT_COLOR]$_POWERLINE_LEFT_HARD_DIVIDER#(env \"\$POWERLINE_COMMAND\" tmux left --width=`tmux display -p '#{client_width}'` -R width_adjust=`tmux show-options -g status-right-length | cut -d' ' -f2` -R pane_id=`tmux display -p '#D'`)" +# vim: ft=tmux From a718a105914366049cd8d99e64c08e33f7c6aaa3 Mon Sep 17 00:00:00 2001 From: Foo Date: Sat, 23 May 2015 16:10:46 +0300 Subject: [PATCH 4/4] Add integration tests for tmux segment truncation --- tests/lib/terminal.py | 8 ++ tests/lib/vterm.py | 8 ++ tests/test_in_vterm/test_tmux.py | 150 +++++++++++++++++++++---------- 3 files changed, 120 insertions(+), 46 deletions(-) diff --git a/tests/lib/terminal.py b/tests/lib/terminal.py index f026ec57..684b2082 100644 --- a/tests/lib/terminal.py +++ b/tests/lib/terminal.py @@ -28,6 +28,7 @@ class ExpectProcess(threading.Thread): child = pexpect.spawn(self.cmd, self.args, cwd=self.cwd, env=self.env) sleep(0.5) child.setwinsize(self.rows, self.cols) + sleep(0.5) self.child = child status = None while status is None: @@ -44,6 +45,13 @@ class ExpectProcess(threading.Thread): self.vterm.push(s) self.buffer.append(s) + def resize(self, rows, cols): + with self.child_lock: + self.rows = rows + self.cols = cols + self.child.setwinsize(rows, cols) + self.vterm.resize(rows, cols) + def __getitem__(self, position): with self.lock: return self.vterm.vtscreen[position] diff --git a/tests/lib/vterm.py b/tests/lib/vterm.py index c83235ec..26964a2b 100644 --- a/tests/lib/vterm.py +++ b/tests/lib/vterm.py @@ -91,6 +91,11 @@ def get_functions(lib): ('cols', ctypes.c_int) )), vterm_obtain_screen=(VTermScreen_p, (('vt', VTerm_p),)), + vterm_set_size=(None, ( + ('vt', VTerm_p), + ('rows', ctypes.c_int), + ('cols', ctypes.c_int) + )), vterm_screen_reset=(None, ( ('screen', VTermScreen_p), ('hard', ctypes.c_int) @@ -171,6 +176,9 @@ class VTerm(object): data = data.encode('utf-8') return self.functions.vterm_input_write(self.vt, data, len(data)) + def resize(self, rows, cols): + self.functions.vterm_set_size(self.vt, rows, cols) + def __del__(self): try: self.functions.vterm_free(self.vt) diff --git a/tests/test_in_vterm/test_tmux.py b/tests/test_in_vterm/test_tmux.py index 5968fc22..6454d69c 100755 --- a/tests/test_in_vterm/test_tmux.py +++ b/tests/test_in_vterm/test_tmux.py @@ -54,6 +54,7 @@ def test_expected_result(p, expected_result, cols, rows, print_logs): for key, text in result )) print(shesc_result) + print(result) print('Expected:') shesc_expected_result = ''.join(( '{0}{1}\x1b[m'.format(cell_properties_key_to_shell_escape(key), text) @@ -95,6 +96,17 @@ def test_expected_result(p, expected_result, cols, rows, print_logs): return False +def get_expected_result(tmux_version, expected_result_old, expected_result_1_7=None, expected_result_new=None, expected_result_2_0=None): + if tmux_version >= (2, 0) and expected_result_2_0: + return expected_result_2_0 + elif tmux_version >= (1, 8) and expected_result_new: + return expected_result_new + elif tmux_version >= (1, 7) and expected_result_1_7: + return expected_result_1_7 + else: + return expected_result_old + + def main(attempts=3): vterm_path = os.path.join(VTERM_TEST_DIR, 'path') socket_path = 'tmux-socket' @@ -165,8 +177,8 @@ def main(attempts=3): 'POWERLINE_CONFIG_PATHS': os.path.abspath('powerline/config_files'), 'POWERLINE_COMMAND': 'powerline-render', 'POWERLINE_THEME_OVERRIDES': ( - 'default.segments.right=[{"type":"string","name":"s1","highlight_groups":["cwd"]}];' - 'default.segments.left=[{"type":"string","name":"s2","highlight_groups":["background"]}];' + 'default.segments.right=[{"type":"string","name":"s1","highlight_groups":["cwd"],"priority":50}];' + 'default.segments.left=[{"type":"string","name":"s2","highlight_groups":["background"],"priority":20}];' 'default.segment_data.s1.contents=S1 string here;' 'default.segment_data.s2.contents=S2 string here;' ), @@ -175,8 +187,47 @@ def main(attempts=3): }, ) p.start() - sleep(2) - expected_result_2_0 = ( + sleep(5) + tmux_version = get_tmux_version(get_fallback_logger()) + expected_result = get_expected_result(tmux_version, expected_result_old=( + (((0, 0, 0), (243, 243, 243), 1, 0, 0), ' 0 '), + (((243, 243, 243), (11, 11, 11), 0, 0, 0), ' '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' S2 string here '), + (((133, 133, 133), (11, 11, 11), 0, 0, 0), ' 0 '), + (((88, 88, 88), (11, 11, 11), 0, 0, 0), '| '), + (((188, 188, 188), (11, 11, 11), 0, 0, 0), 'bash '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), + (((133, 133, 133), (11, 11, 11), 0, 0, 0), ' 1 '), + (((88, 88, 88), (11, 11, 11), 0, 0, 0), '| '), + (((188, 188, 188), (11, 11, 11), 0, 0, 0), 'bash '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), + (((11, 11, 11), (0, 102, 153), 0, 0, 0), ' '), + (((102, 204, 255), (0, 102, 153), 0, 0, 0), '2 | '), + (((255, 255, 255), (0, 102, 153), 1, 0, 0), 'bash '), + (((0, 102, 153), (11, 11, 11), 0, 0, 0), ' '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' ' * 127), + (((88, 88, 88), (11, 11, 11), 0, 0, 0), ' '), + (((199, 199, 199), (88, 88, 88), 0, 0, 0), ' S1 string here '), + ), expected_result_new=( + (((0, 0, 0), (243, 243, 243), 1, 0, 0), ' 0 '), + (((243, 243, 243), (11, 11, 11), 0, 0, 0), ' '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' S2 string here '), + (((133, 133, 133), (11, 11, 11), 0, 0, 0), ' 0 '), + (((88, 88, 88), (11, 11, 11), 0, 0, 0), '| '), + (((188, 188, 188), (11, 11, 11), 0, 0, 0), 'bash '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), + (((133, 133, 133), (11, 11, 11), 0, 0, 0), ' 1 '), + (((88, 88, 88), (11, 11, 11), 0, 0, 0), '| '), + (((0, 102, 153), (11, 11, 11), 0, 0, 0), 'bash '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), + (((11, 11, 11), (0, 102, 153), 0, 0, 0), ' '), + (((102, 204, 255), (0, 102, 153), 0, 0, 0), '2 | '), + (((255, 255, 255), (0, 102, 153), 1, 0, 0), 'bash '), + (((0, 102, 153), (11, 11, 11), 0, 0, 0), ' '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' ' * 127), + (((88, 88, 88), (11, 11, 11), 0, 0, 0), ' '), + (((199, 199, 199), (88, 88, 88), 0, 0, 0), ' S1 string here '), + ), expected_result_2_0=( (((0, 0, 0), (243, 243, 243), 1, 0, 0), ' 0 '), (((243, 243, 243), (11, 11, 11), 0, 0, 0), ' '), (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' S2 string here '), @@ -195,62 +246,69 @@ def main(attempts=3): (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' ' * 128), (((88, 88, 88), (11, 11, 11), 0, 0, 0), ' '), (((199, 199, 199), (88, 88, 88), 0, 0, 0), ' S1 string here '), - ) - expected_result_new = ( + )) + ret = None + if not test_expected_result(p, expected_result, cols, rows, not attempts): + if attempts: + pass + # Will rerun main later. + else: + ret = False + elif ret is not False: + ret = True + cols = 40 + p.resize(rows, cols) + sleep(5) + expected_result = get_expected_result(tmux_version, ( + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' ' * cols), + ), expected_result_1_7=( (((0, 0, 0), (243, 243, 243), 1, 0, 0), ' 0 '), (((243, 243, 243), (11, 11, 11), 0, 0, 0), ' '), - (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' S2 string here '), - (((133, 133, 133), (11, 11, 11), 0, 0, 0), ' 0 '), - (((88, 88, 88), (11, 11, 11), 0, 0, 0), '| '), - (((188, 188, 188), (11, 11, 11), 0, 0, 0), 'bash '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' <'), + (((188, 188, 188), (11, 11, 11), 0, 0, 0), 'sh '), (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), - (((133, 133, 133), (11, 11, 11), 0, 0, 0), ' 1 '), - (((88, 88, 88), (11, 11, 11), 0, 0, 0), '| '), + (((11, 11, 11), (0, 102, 153), 0, 0, 0), ' '), + (((102, 204, 255), (0, 102, 153), 0, 0, 0), '2 | '), + (((255, 255, 255), (0, 102, 153), 1, 0, 0), 'bash '), + (((0, 102, 153), (11, 11, 11), 0, 0, 0), ' '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), + (((88, 88, 88), (11, 11, 11), 0, 0, 0), ' '), + (((199, 199, 199), (88, 88, 88), 0, 0, 0), ' S1 string here ') + ), expected_result_new=( + (((0, 0, 0), (243, 243, 243), 1, 0, 0), ' 0 '), + (((243, 243, 243), (11, 11, 11), 0, 0, 0), ' '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' <'), + (((0, 102, 153), (11, 11, 11), 0, 0, 0), 'sh '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), + (((11, 11, 11), (0, 102, 153), 0, 0, 0), ' '), + (((102, 204, 255), (0, 102, 153), 0, 0, 0), '2 | '), + (((255, 255, 255), (0, 102, 153), 1, 0, 0), 'bash '), + (((0, 102, 153), (11, 11, 11), 0, 0, 0), ' '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), + (((88, 88, 88), (11, 11, 11), 0, 0, 0), ' '), + (((199, 199, 199), (88, 88, 88), 0, 0, 0), ' S1 string here ') + ), expected_result_2_0=( + (((0, 0, 0), (243, 243, 243), 1, 0, 0), ' 0 '), + (((243, 243, 243), (11, 11, 11), 0, 0, 0), ' '), + (((255, 255, 255), (11, 11, 11), 0, 0, 0), '<'), (((0, 102, 153), (11, 11, 11), 0, 0, 0), 'bash '), (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), (((11, 11, 11), (0, 102, 153), 0, 0, 0), ' '), (((102, 204, 255), (0, 102, 153), 0, 0, 0), '2 | '), (((255, 255, 255), (0, 102, 153), 1, 0, 0), 'bash '), (((0, 102, 153), (11, 11, 11), 0, 0, 0), ' '), - (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' ' * 127), (((88, 88, 88), (11, 11, 11), 0, 0, 0), ' '), - (((199, 199, 199), (88, 88, 88), 0, 0, 0), ' S1 string here '), - ) - expected_result_old = ( - (((0, 0, 0), (243, 243, 243), 1, 0, 0), ' 0 '), - (((243, 243, 243), (11, 11, 11), 0, 0, 0), ' '), - (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' S2 string here '), - (((133, 133, 133), (11, 11, 11), 0, 0, 0), ' 0 '), - (((88, 88, 88), (11, 11, 11), 0, 0, 0), '| '), - (((188, 188, 188), (11, 11, 11), 0, 0, 0), 'bash '), - (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), - (((133, 133, 133), (11, 11, 11), 0, 0, 0), ' 1 '), - (((88, 88, 88), (11, 11, 11), 0, 0, 0), '| '), - (((188, 188, 188), (11, 11, 11), 0, 0, 0), 'bash '), - (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' '), - (((11, 11, 11), (0, 102, 153), 0, 0, 0), ' '), - (((102, 204, 255), (0, 102, 153), 0, 0, 0), '2 | '), - (((255, 255, 255), (0, 102, 153), 1, 0, 0), 'bash '), - (((0, 102, 153), (11, 11, 11), 0, 0, 0), ' '), - (((255, 255, 255), (11, 11, 11), 0, 0, 0), ' ' * 127), - (((88, 88, 88), (11, 11, 11), 0, 0, 0), ' '), - (((199, 199, 199), (88, 88, 88), 0, 0, 0), ' S1 string here '), - ) - tmux_version = get_tmux_version(get_fallback_logger()) - if tmux_version >= (2, 0): - expected_result = expected_result_2_0 - elif tmux_version >= (1, 8): - expected_result = expected_result_new - else: - expected_result = expected_result_old + (((199, 199, 199), (88, 88, 88), 0, 0, 0), ' S1 string here ') + )) if not test_expected_result(p, expected_result, cols, rows, not attempts): if attempts: pass - # Will rerun main later. else: - return False - else: - return True + ret = False + elif ret is not False: + ret = True + if ret is not None: + return ret finally: check_call([tmux_exe, '-S', socket_path, 'kill-server'], env={ 'PATH': vterm_path,