Skip to content

Commit 3edfd2a

Browse files
pythopstony
authored andcommitted
Add ls option to cli
1 parent f68609d commit 3edfd2a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tmuxp/cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import logging
1111
import os
1212
import sys
13+
from pathlib import Path
1314

1415
import click
1516
import kaptan
@@ -924,3 +925,11 @@ def command_convert(config):
924925
buf.write(newconfig)
925926
buf.close()
926927
print('New config saved to <%s>.' % newfile)
928+
929+
930+
@cli.command(name='ls', short_help='List configured sessions in $HOME/.tmuxp dir.')
931+
def command_ls():
932+
tmuxp_dir = Path.home() / '.tmuxp'
933+
if tmuxp_dir.exists() and tmuxp_dir.is_dir():
934+
for f in tmuxp_dir.iterdir():
935+
print(f.stem)

0 commit comments

Comments
 (0)