Skip to content

Commit 9d4e52b

Browse files
authored
run_before_script: Fix newlines (#960)
Follow up to #958, #959
2 parents 001b85c + 7f1b862 commit 9d4e52b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGES

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ $ pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force
1919

2020
<!-- Maintainers, insert changes / features for the next release here -->
2121

22+
### Bug fixes
23+
24+
- `run_before_script()`: Additional output capturing improvements (#960)
25+
2226
## tmuxp 1.52.1 (2025-02-02)
2327

2428
### Bug fixes

src/tmuxp/util.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ def run_before_script(
6565
# Read one line from stderr, if available
6666
line_err = proc.stderr.readline() if proc.stderr else ""
6767

68-
if line_out:
68+
if line_out and line_out.strip():
6969
out_buffer.append(line_out)
7070
if is_out_tty:
7171
sys.stdout.write(line_out)
7272
sys.stdout.flush()
7373

74-
if line_err:
74+
if line_err and line_err.strip():
7575
err_buffer.append(line_err)
7676
if is_err_tty:
7777
sys.stderr.write(line_err)

0 commit comments

Comments
 (0)