Skip to content

Commit 19629dd

Browse files
committed
Add flag to overwrite config files on freeze
1 parent bdb2154 commit 19629dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tmuxp/cli.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,8 @@ def startup(config_dir):
659659
@click.argument('session_name', nargs=1, required=False)
660660
@click.option('-S', 'socket_path', help='pass-through for tmux -S')
661661
@click.option('-L', 'socket_name', help='pass-through for tmux -L')
662-
def command_freeze(session_name, socket_name, socket_path):
662+
@click.option('--force', 'force', help='overwrite the config file', is_flag=True)
663+
def command_freeze(session_name, socket_name, socket_path, force):
663664
"""Snapshot a session into a config.
664665
665666
If SESSION_NAME is provided, snapshot that session. Otherwise, use the
@@ -716,7 +717,7 @@ def command_freeze(session_name, socket_name, socket_path):
716717
dest_prompt = click.prompt(
717718
'Save to: %s' % save_to, value_proc=get_abs_path, default=save_to
718719
)
719-
if os.path.exists(dest_prompt):
720+
if not force and os.path.exists(dest_prompt):
720721
print('%s exists. Pick a new filename.' % dest_prompt)
721722
continue
722723

0 commit comments

Comments
 (0)