@@ -302,14 +302,16 @@ def get_server_from_args(args):
302302def command_freeze (args ):
303303 """ Import teamocil config to tmuxp format. """
304304
305+ ctext = ' ' .join (args .session_name )
306+
305307 t = Server (
306308 socket_name = args .socket_name ,
307309 socket_path = args .socket_path ,
308310 colors = args .colors
309311 )
310312
311313 session = t .findWhere ({
312- 'session_name' : args . session_name
314+ 'session_name' : ctext
313315 })
314316
315317 sconf = freeze (session )
@@ -627,20 +629,21 @@ def command_convert(args):
627629def command_attach_session (args ):
628630 """ Command to attach / switch client to a tmux session."""
629631 commands = []
630- ctext = args .session_name
632+ ctext = ' ' . join ( args .session_name )
631633
632634 t = Server (
633635 socket_name = args .socket_name ,
634636 socket_path = args .socket_path ,
635637 colors = args .colors
636638 )
639+
637640 try :
638641 session = next ((s for s in t .sessions if s .get (
639642 'session_name' ) == ctext ), None )
640643 if not session :
641644 raise Exception ('Session not found.' )
642645 except Exception as e :
643- print (e .message [ 0 ] )
646+ print (e .message )
644647 return
645648
646649 if 'TMUX' in os .environ :
@@ -655,7 +658,7 @@ def command_attach_session(args):
655658def command_kill_session (args ):
656659 """ Command to kill a tmux session."""
657660 commands = []
658- ctext = args .session_name
661+ ctext = ' ' . join ( args .session_name )
659662
660663 t = Server (
661664 socket_name = args .socket_name or None ,
@@ -668,11 +671,12 @@ def command_kill_session(args):
668671 if not session :
669672 raise Exception ('Session not found.' )
670673 except Exception as e :
671- print (e .message [ 0 ] )
674+ print (e .message )
672675 return
673676
674677 try :
675678 session .kill_session ()
679+ print ("Killed session %s." % ctext )
676680 except Exception as e :
677681 logger .error (e )
678682
@@ -696,15 +700,19 @@ def get_parser():
696700 kill_session .add_argument (
697701 dest = 'session_name' ,
698702 type = str ,
703+ nargs = '+' ,
699704 default = None ,
705+ help = 'Name of session' ,
700706 ).completer = SessionCompleter
701707
702708 attach_session = subparsers .add_parser ('attach-session' )
703709 attach_session .set_defaults (callback = command_attach_session )
704710
705711 attach_session .add_argument (
706712 dest = 'session_name' ,
713+ nargs = '+' ,
707714 type = str ,
715+ help = 'Name of session' ,
708716 ).completer = SessionCompleter
709717
710718 freeze = subparsers .add_parser ('freeze' )
@@ -713,6 +721,8 @@ def get_parser():
713721 freeze .add_argument (
714722 dest = 'session_name' ,
715723 type = str ,
724+ nargs = '+' ,
725+ help = 'Name of session' ,
716726 ).completer = SessionCompleter
717727
718728 load = subparsers .add_parser ('load' )
0 commit comments