From 662827e709b9cec526fe646d543f93b783fc2ace Mon Sep 17 00:00:00 2001 From: Gerard Roche Date: Tue, 23 Jan 2024 14:32:28 +0000 Subject: [PATCH] fix: tmux clear scrollback setting not working correctly --- CHANGELOG.md | 6 ++++++ Preferences.sublime-settings | 5 +++-- README.md | 2 +- lib/strategy.py | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8856fe8..8d1d16d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## 3.19.1 - 2024-01-23 + +### Fixed + +- Tmux strategy `phpunit.tmux_clear_scrollback` setting is not working correctly + ## 3.19.0 - 2024-01-22 ### Added diff --git a/Preferences.sublime-settings b/Preferences.sublime-settings index f9c5d5c..df628ae 100644 --- a/Preferences.sublime-settings +++ b/Preferences.sublime-settings @@ -99,8 +99,9 @@ // Clear the terminal screen before running tests. "phpunit.tmux_clear": true, - // Clear the terminal's scrollback buffer using the extended "E3" capability. - "phpunit.tmux_clear_scrollback": false, + // Clear the terminal's scrollback buffer or do not attempt to clear it + // using the extended "E3" capability. + "phpunit.tmux_clear_scrollback": true, // Specify the session, window, and pane which should be used to run tests. // diff --git a/README.md b/README.md index 564d559..8903d77 100644 --- a/README.md +++ b/README.md @@ -226,7 +226,7 @@ Configure Tmux settings for running tests in a tmux pane: | Setting | Type | Default | Description | :-------------------------------- | :------------ | :-------- | :---------- | `phpunit.tmux_clear` | `bool` | `true` | Clear the terminal screen before running tests. -| `phpunit.tmux_clear_scrollback` | `bool` | `false` | Clear the terminal's scrollback buffer using the extended "E3" capability. +| `phpunit.tmux_clear_scrollback` | `bool` | `true` | Clear the terminal's scrollback buffer or do not attempt to clear it using the extended "E3" capability. | `phpunit.tmux_target` | `string` | `:.` | Specify the session, window, and pane which should be used to run tests.

Format: `{session}:{window}.{pane}`

The default means the current pane.

For example, `:{start}.{top}` would mean the current session, lowest-numbered window, top pane.

See [Tmux documentation](http://man.openbsd.org/OpenBSD-current/man1/tmux.1#COMMANDS) for target usage. ### CLI Options diff --git a/lib/strategy.py b/lib/strategy.py index ab1afc0..6823d87 100644 --- a/lib/strategy.py +++ b/lib/strategy.py @@ -153,7 +153,7 @@ def build_tmux_cmd(view, working_dir: str, cmd: list) -> list: # Clear the terminal screen. if get_setting(view, 'tmux_clear'): clear_cmd = ['clear'] - if get_setting(view, 'tmux_clear_scrollback'): + if not get_setting(view, 'tmux_clear_scrollback'): clear_cmd.append('-x') key_cmds.append(shlex.join(clear_cmd))