@@ -359,6 +359,12 @@ def test_automatic_rename_option(session):
359
359
sconfig = kaptan .Kaptan (handler = "yaml" )
360
360
sconfig = sconfig .import_config (yaml_config ).get ()
361
361
362
+ # This should be a command guaranteed to be terminal name across systems
363
+ portable_command = sconfig ["windows" ][0 ]["panes" ][0 ]["shell_command" ][0 ]["cmd" ]
364
+ # If a command is like "man ls", get the command base name, "ls"
365
+ if " " in portable_command :
366
+ portable_command = portable_command .split (" " )[0 ]
367
+
362
368
builder = WorkspaceBuilder (sconf = sconfig )
363
369
364
370
window_count = len (session ._windows ) # current window count
@@ -380,31 +386,36 @@ def test_automatic_rename_option(session):
380
386
assert s .name != "tmuxp"
381
387
w = s .windows [0 ]
382
388
383
- while retry ():
389
+ t = time .process_time ()
390
+ while (time .process_time () - t ) * 1000 < 2 :
384
391
session .server ._update_windows ()
385
- if w .name != "sh" :
392
+ if w .name != portable_command :
386
393
break
394
+ time .sleep (0.2 )
387
395
388
- assert w .name != "sh"
396
+ assert w .name != portable_command
389
397
390
398
pane_base_index = w .show_window_option ("pane-base-index" , g = True )
391
399
w .select_pane (pane_base_index )
392
400
393
- while retry ():
401
+ t = time .process_time ()
402
+ while (time .process_time () - t ) * 1000 < 20 :
394
403
session .server ._update_windows ()
395
- if w .name == "sh" :
404
+ if w .name == portable_command :
396
405
break
406
+ time .sleep (0.2 )
397
407
398
- assert w .name == "sh"
408
+ assert w .name == portable_command
399
409
400
410
w .select_pane ("-D" )
401
411
402
- while retry ():
412
+ t = time .process_time ()
413
+ while (time .process_time () - t ) * 1000 < 2 :
403
414
session .server ._update_windows ()
404
- if w ["window_name" ] != "sh" :
415
+ if w ["window_name" ] != portable_command :
405
416
break
406
-
407
- assert w .name != "sh"
417
+ time . sleep ( 0.2 )
418
+ assert w .name != portable_command
408
419
409
420
410
421
def test_blank_pane_count (session ):
0 commit comments