Skip to content
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

KeyError #470

Closed
Pastafarianist opened this issue Jan 14, 2019 · 3 comments

Comments

Projects
None yet
5 participants
@Pastafarianist
Copy link

commented Jan 14, 2019

A rather simple .yaml config triggers a KeyError:

$ cat .tmuxp/background.yaml 
session_name: background
windows:
  - window_name: jupyter
    panes:
    - limitmem 8G jupyter notebook
  - window_name: ssh
$ tmuxp load background
Traceback (most recent call last):
  File "/usr/bin/tmuxp", line 11, in <module>
    load_entry_point('tmuxp==1.5.0a1', 'console_scripts', 'tmuxp')()
  File "/usr/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/tmuxp/cli.py", line 797, in command_load
    load_workspace(config[-1], **tmux_options)
  File "/usr/lib/python3.7/site-packages/tmuxp/cli.py", line 483, in load_workspace
    sconfig = config.trickle(sconfig)
  File "/usr/lib/python3.7/site-packages/tmuxp/config.py", line 373, in trickle
    for paneconfig in windowconfig['panes']:
KeyError: 'panes'
@tony

This comment has been minimized.

Copy link
Member

commented Jan 16, 2019

@Pastafarianist

The second window needs a pane

session_name: background
windows:
  - window_name: jupyter
    panes:
    - limitmem 8G jupyter notebook
  - window_name: ssh
     panes:
     -

Though I think it makes sense to infer a pane without it. We should add this to tmuxp. It's a good idea!

@matrixise

This comment has been minimized.

Copy link

commented Apr 5, 2019

Hi, maybe a small fix, should be to show a message: No panes for the window "ssh"?

I have the same problem just now.

@krigstask

This comment has been minimized.

Copy link

commented May 12, 2019

Crashing with KeyError isn't very nice anyway, I just had one due to a typo in session_name.

@kstilwell kstilwell closed this May 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.