@@ -463,30 +463,17 @@ def config_shell_complete(ctx, params, incomplete):
463
463
# CWD Paths
464
464
# CWD + Parents
465
465
choices += [
466
- os .path .relpath (p , pathlib .Path .cwd ())
467
- # p.relative_to(pathlib.Path.cwd())
466
+ pathlib .Path (os .path .relpath (p , pathlib .Path .cwd ()))
468
467
for p in [pathlib .Path .cwd (), * pathlib .Path .cwd ().parents ]
469
468
if config .in_dir (str (p )) or len (list (p .glob (".tmuxp.*" )))
470
- # or len(list(concat(p.glob(".tmuxp.*"), p.glob("*/.tmuxp.*"))))
471
- # if scan_config(config=p, config_dir=config_dir, raises=False)
472
469
]
473
470
# CWD look one directory up
474
471
choices += [
475
- f"./{ os .path .relpath (p , pathlib .Path .cwd ())} "
476
- # p.relative_to(pathlib.Path.cwd())
472
+ pathlib .Path (f"./{ os .path .relpath (p , pathlib .Path .cwd ())} " )
477
473
for p in pathlib .Path .cwd ().glob ("*/.tmuxp.*" )
478
- # or len(list(concat(p.glob(".tmuxp.*"), p.glob("*/.tmuxp.*"))))
479
- # if scan_config(config=p, config_dir=config_dir, raises=False)
480
474
]
481
475
482
- ### str
483
- choices = [str (p ) for p in choices ]
484
- return [CompletionItem (choice ) for choice in choices ]
485
-
486
- return [
487
- CompletionItem (choice ) for choice in choices if choice .startswith (incomplete )
488
- ]
489
- return [CompletionItem (choice ) for choice in choices if incomplete in choice ]
476
+ return [str (c ) for c in choices ]
490
477
491
478
492
479
@click .command (name = "load" , short_help = "Load tmuxp workspaces." )
0 commit comments