@@ -173,6 +173,8 @@ def assertIsMissing(cmd, hist):
173
173
p .cmd ("send-keys" , "Enter" )
174
174
175
175
buffer_name = "test"
176
+ sent_cmd = None
177
+
176
178
def f ():
177
179
# from v0.7.4 libtmux session.cmd adds target -t self.id by default
178
180
# show-buffer doesn't accept -t, use global cmd.
@@ -186,8 +188,10 @@ def f():
186
188
# Parse the sent and last-in-history commands
187
189
sent_cmd = captured_pane .stdout [0 ].strip ()
188
190
history_cmd = captured_pane .stdout [- 2 ].strip ()
191
+ p .server ._update_panes ()
189
192
190
193
return assertCase (sent_cmd , history_cmd )
194
+
191
195
assert retry_until (f ), f"Unknown sent command: [{ sent_cmd } ] in { assertCase } "
192
196
193
197
@@ -282,6 +286,8 @@ def test_window_options_after(session):
282
286
builder = WorkspaceBuilder (sconf = sconfig )
283
287
builder .build (session = session )
284
288
289
+ pane_out = []
290
+
285
291
def assert_last_line (p , s ):
286
292
def f ():
287
293
pane_out = p .cmd ("capture-pane" , "-p" , "-J" ).stdout
@@ -292,11 +298,8 @@ def f():
292
298
# Print output for easier debugging if assertion fails
293
299
if retry_until (f , raises = False ):
294
300
return True
295
- else :
296
- print ("\n " .join (pane_out ))
297
- return False
298
-
299
- return correct
301
+ print ("\n " .join (pane_out ))
302
+ return False
300
303
301
304
for i , pane in enumerate (session .attached_window .panes ):
302
305
assert assert_last_line (
@@ -333,6 +336,7 @@ def test_window_shell(session):
333
336
def f ():
334
337
session .server ._update_windows ()
335
338
return w ["window_name" ] != "top"
339
+
336
340
retry_until (f )
337
341
338
342
assert w .name != "top"
@@ -449,6 +453,7 @@ def test_start_directory(session, tmp_path: pathlib.Path):
449
453
450
454
for path , window in zip (dirs , session .windows ):
451
455
for p in window .panes :
456
+
452
457
def f ():
453
458
p .server ._update_panes ()
454
459
pane_path = p .current_path
@@ -499,6 +504,7 @@ def test_start_directory_relative(session, tmp_path: pathlib.Path):
499
504
500
505
for path , window in zip (dirs , session .windows ):
501
506
for p in window .panes :
507
+
502
508
def f ():
503
509
p .server ._update_panes ()
504
510
# Handle case where directories resolve to /private/ in OSX
@@ -560,6 +566,7 @@ def test_pane_order(session):
560
566
def f ():
561
567
p .server ._update_panes ()
562
568
return p .current_path == pane_path
569
+
563
570
retry_until (f )
564
571
565
572
assert p .current_path , pane_path
0 commit comments