Skip to content

Commit 8e76a62

Browse files
committed
Show error message when save_as_session has too many path arguments
1 parent e7aa197 commit 8e76a62

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kitty/session.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,10 @@ def default_save_as_session_opts() -> SaveAsSessionOptions:
719719

720720
def save_as_session(boss: BossType, cmdline: Sequence[str]) -> None:
721721
opts, args = parse_save_as_options_spec_args(list(cmdline))
722+
if args and len(args) > 1:
723+
boss.show_error(_('Invalid save_as_session command line'), _(
724+
'save_as_session must have no more than a single path argument. Note that any flags/options should come before the path'))
725+
return
722726
path = args[0] if args else ''
723727
if path == '.':
724728
sn = boss.active_session

0 commit comments

Comments
 (0)