Skip to content

Commit 162eaf9

Browse files
committed
fix(test_pane): add capture_pane test
1 parent 3c0d700 commit 162eaf9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_pane.py

+14
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,17 @@ def test_set_width(session: Session) -> None:
6363
assert int(pane1["pane_width"]) == 10
6464

6565
pane1.reset()
66+
67+
def test_capture_pane(session: Session) -> None:
68+
session.new_window(
69+
attach=True,
70+
window_name="capture_pane",
71+
window_shell='env -i PS1="$ " /usr/bin/env bash --norc --noprofile'
72+
)
73+
pane = session.attached_window.attached_pane
74+
assert pane is not None
75+
pane_contents = "\n".join(pane.capture_pane())
76+
assert pane_contents == '$'
77+
pane.send_keys(r'printf "\n%s\n" "Hello World !"', literal=True, suppress_history=False)
78+
pane_contents = "\n".join(pane.capture_pane())
79+
assert pane_contents == r'$ printf "\n%s\n" "Hello World !"{}'.format('\n\nHello World !\n$')

0 commit comments

Comments
 (0)