Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
borisjoffe opened this issue Oct 11, 2016 · 3 comments
Closed

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

borisjoffe opened this issue Oct 11, 2016 · 3 comments
Labels

Comments

@borisjoffe
Copy link

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.

@BlitzKraft
Copy link

I have a similar issue, when the window title is empty.

Traceback (most recent call last):
  File "/usr/local/bin/tmuxp", line 11, in <module>
    load_entry_point('tmuxp==1.2.2', 'console_scripts', 'tmuxp')()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tmuxp/cli.py", line 511, in command_load
    load_workspace(config[-1], **tmux_options)
  File "/usr/local/lib/python2.7/dist-packages/tmuxp/cli.py", line 221, in load_workspace
    sconfig = config.expand(sconfig, os.path.dirname(config_file))
  File "/usr/local/lib/python2.7/dist-packages/tmuxp/config.py", line 265, in expand
    expand(window, parent=sconf) for window in sconf['windows']
  File "/usr/local/lib/python2.7/dist-packages/tmuxp/config.py", line 193, in expand
    sconf['window_name'] = expandshell(sconf['window_name'])
  File "/usr/local/lib/python2.7/dist-packages/tmuxp/config.py", line 117, in expandshell
    return os.path.expandvars(os.path.expanduser(_path))
  File "/usr/lib/python2.7/posixpath.py", line 261, in expanduser
    if not path.startswith('~'):
AttributeError: 'NoneType' object has no attribute 'startswith'

@BlitzKraft
Copy link

I found a work-around by running tmux rename-window '' in one of the panes in the specified window. That works for me. Not as elegant, but achieves what I want.

BlitzKraft pushed a commit to BlitzKraft/tmuxp that referenced this issue Nov 10, 2016
Added functions for testing empty titles and a config
window_title_empty.yaml.
@stale
Copy link

stale bot commented Nov 11, 2017

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.

This bot is used to handle issues where the issue hasn't been discussed or
has gone out of date. If an issue isn't resolved and handled in a certain
period of time, it may be closed. If you would like your issue re-opened,
please create a fresh issue with the latest, up to date information and
mention this issue in it.

@stale stale bot added the stale label Nov 11, 2017
@stale stale bot closed this as completed Nov 18, 2017
BlitzKraft pushed a commit to BlitzKraft/tmuxp that referenced this issue Aug 16, 2020
Added functions for testing empty titles and a config
window_title_empty.yaml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants