Skip to content

Commit 96fddc1

Browse files
kstilwelltony
authored andcommitted
- Allow for session name to not be passed to tmux freeze
- If session is not provided grab what is most likely the current session
1 parent b90f7ec commit 96fddc1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tmuxp/cli.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def startup(config_dir):
652652

653653

654654
@cli.command(name='freeze')
655-
@click.argument('session_name', nargs=1)
655+
@click.argument('session_name', nargs=1, required=False)
656656
@click.option('-S', 'socket_path', help='pass-through for tmux -S')
657657
@click.option('-L', 'socket_name', help='pass-through for tmux -L')
658658
def command_freeze(session_name, socket_name, socket_path):
@@ -664,7 +664,10 @@ def command_freeze(session_name, socket_name, socket_path):
664664
t = Server(socket_name=socket_name, socket_path=socket_path)
665665

666666
try:
667-
session = t.find_where({'session_name': session_name})
667+
if session_name:
668+
session = t.find_where({'session_name': session_name})
669+
else:
670+
session = t.list_sessions()[0]
668671

669672
if not session:
670673
raise exc.TmuxpException('Session not found.')

0 commit comments

Comments
 (0)