Skip to content

Session name with number at end won't load #183

@borisjoffe

Description

@borisjoffe

tmux 2.3
tmuxp 1.2.2

Repro steps:

  • Freeze a current tmux session
  • Change session_name to test in the yaml file
  • Duplicate the yaml file
  • Change session_name to test2 in the duplicate file
  • Use tmuxp to load test2 in a terminal window
  • Use tmuxp to load test in a different window

Expected result:

  • Both sessions load

Actual result:

  • Second session shows message "test is already running. Attach?"
  • If you try to attach to the session, it crashes with the following stacktrace:
Traceback (most recent call last):
  File "/bin/tmuxp", line 11, in <module>
    load_entry_point('tmuxp==1.2.2', 'console_scripts', 'tmuxp')()
  File "/usr/lib/python3.5/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.5/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3.5/site-packages/tmuxp/cli.py", line 511, in command_load
    load_workspace(config[-1], **tmux_options)
  File "/usr/lib/python3.5/site-packages/tmuxp/cli.py", line 253, in load_workspace
    reattach(builder.session)
  File "/usr/lib/python3.5/site-packages/tmuxp/cli.py", line 244, in reattach
    session.attach_session()
AttributeError: 'NoneType' object has no attribute 'attach_session'

#132 was a similar issue except with dots instead of numbers

Also, if the number is within the session_name, it works correctly, and if test is loaded before test2, it also works correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions