Skip to content

Commit 2346df4

Browse files
rockandskatony
andcommitted
chore(tmux_cmd): Tweak filtering of trailing newlines
Co-authored-by: Tony Narlock <[email protected]>
1 parent 4c48599 commit 2346df4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: libtmux/common.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,8 @@ def __init__(self, *args: t.Any, **kwargs: t.Any) -> None:
271271
stdout_str = console_to_str(stdout)
272272
stdout_split = stdout_str.split("\n")
273273
# remove trailing newlines from stdout
274-
for v in reversed(stdout_split):
275-
if v == '':
276-
stdout_split.pop()
277-
else:
278-
break
274+
while stdout_split and stdout_split[-1] == "":
275+
stdout_split.pop()
279276

280277
stderr_str = console_to_str(stderr)
281278
stderr_split = stderr_str.split("\n")

0 commit comments

Comments
 (0)