@@ -399,7 +399,18 @@ def command_load(args):
399399 """Load a session from a tmuxp session file."""
400400
401401 if isinstance (args .config , list ):
402- args .config = ' ' .join (args .config )
402+ # Load each configuration but the last to the background
403+ for cfg in args .config [:- 1 ]:
404+ new_args = argparse .Namespace (** args .__dict__ )
405+ new_args .detached = True
406+ new_args .config = cfg
407+ command_load (new_args )
408+
409+ # The last one will be detached if specified on the command line
410+ new_args = argparse .Namespace (** args .__dict__ )
411+ new_args .config = args .config [- 1 ]
412+ command_load (new_args )
413+ return
403414
404415 if '.' == args .config :
405416 if config .in_cwd ():
@@ -818,8 +829,9 @@ def get_parser():
818829 load = subparsers .add_parser (
819830 'load' ,
820831 parents = [server_parser , client_parser ],
821- help = 'Load a configuration from file. Attach the session. If session '
822- 'already exists, offer to attach instead.'
832+ help = 'Load configurations from one or more files. '
833+ 'Attach to the session described by the last file. '
834+ 'If it already exists, offer to attach instead.'
823835 )
824836
825837 load .add_argument (
@@ -836,7 +848,7 @@ def get_parser():
836848 '-d' ,
837849 dest = 'detached' ,
838850 default = None ,
839- help = 'Load a session without attaching to it.' ,
851+ help = 'Load the last session without attaching to it.' ,
840852 action = 'store_true'
841853 )
842854
0 commit comments