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

Have to restart tmuxp two times #23

Closed
lowks opened this Issue Nov 23, 2013 · 9 comments

Comments

Projects
None yet
2 participants
@lowks

lowks commented Nov 23, 2013

Please look at the startup sequence below:

lowks@robot-ng4 ~/Downloads/tmuxp $ tmuxp load ~/.tmuxp/editing.json 
load /home/lowks/.tmuxp/editing.json
(I) [10:11:37] tmuxp.cli cli.load_workspace():256 Loading /home/lowks/.tmuxp/editing.json.
Traceback (most recent call last):
  File "/usr/local/bin/tmuxp", line 9, in <module>
    load_entry_point('tmuxp==0.1.0rc1', 'console_scripts', 'tmuxp')()
  File "/usr/local/lib/python2.7/dist-packages/tmuxp/cli.py", line 977, in main
    command_load(args)
  File "/usr/local/lib/python2.7/dist-packages/tmuxp/cli.py", line 435, in command_load
    load_workspace(file_cwd, args)
  File "/usr/local/lib/python2.7/dist-packages/tmuxp/cli.py", line 278, in load_workspace
    builder.build()
  File "/usr/local/lib/python2.7/dist-packages/tmuxp/workspacebuilder.py", line 138, in build
    for p in self.iter_create_panes(w, wconf):
  File "/usr/local/lib/python2.7/dist-packages/tmuxp/workspacebuilder.py", line 219, in iter_create_panes
    assert int(p.get('pane_index')) == int(pane_base_index + pindex)
AssertionError
lowks@robot-ng4 ~/Downloads/tmuxp $ tmuxp load ~/.tmuxp/editing.json 
load /home/lowks/.tmuxp/editing.json
(I) [10:11:44] tmuxp.cli cli.load_workspace():256 Loading /home/lowks/.tmuxp/editing.json.
Session name 2-pane-vertical is already running. Attach? [Y/n] y

After this second time of loading, then it works.

Edit by Tony. wrapped output so it will be formatted.

@tony

This comment has been minimized.

Member

tony commented Nov 23, 2013

Can you paste me the editing.json and your ~/.tmux.conf if one exists?

@tony

This comment has been minimized.

Member

tony commented Nov 23, 2013

@lowks also, $ tmuxp show-w -g pane-base-index

@lowks

This comment has been minimized.

lowks commented Nov 23, 2013

tmux.conf

## tmux.conf

#### starts indexing from 1 instead of 0;
set-option -g base-index 1
setw -g pane-base-index 1

#### ensures it runs on utf8 encoding
set-option -g status-utf8 on

#### binds a as send-prefix for remote sessions (screen etc)
bind-key a send-prefix

#### starts tmux with 256 colors support
set -g default-terminal "screen-256color"

#### we'll reset tmux to use vim key bindings
set-window-option -g mode-keys vi

#### sets tmux to use vim keys for navigations
unbind-key j
unbind-key k
unbind-key h
unbind-key l

bind-key k select-pane -U
bind-key j select-pane -D
bind-key h select-pane -L
bind-key l select-pane -R

#### tells tmux to behave like screen
unbind C-b
set -g prefix C-a
bind C-a send-prefix

#### sets signs for horizontal and vertical splits
bind-key | split-window -h
bind-key - split-window

# # default statusbar colors
set-option -g status-fg white
set-option -g status-bg black
set-option -g status-attr default

# theming
set-option -g status-fg white
set-option -g status-bg default
set-option -g status-justify centre
set-option -g status-left-length 13
set-option -g status-left '#[fg=green][ #[fg=green,bright]#h #[fg=green,nobright]][#[default]'
set-option -g status-right-length 16
set-option -g status-right '#[fg=green]][ #[fg=black,bright]%m/%d %H:%M #[fg=green,nobright]]#[fg=default]'
set-window-option -g window-status-current-format '#[fg=green,bg=default]( #[fg=white,bright,bg=default]#I:#W#[fg=green,nobright,bg=default] )#[fg=default]'

editing.json

{
  "windows": [
    {
      "panes": [
        "ls", 
        "ls"
      ],
      "focus": true,
      "layout": "main-horizontal",
      "window_name": "Editing Window", 
      "options": {
        "main-pane-height": 300
      }
    }
  ], 
  "session_name": "Editting"
}

"tmuxp show-w -g pane-base-index"

The second does not seem to be a valid command.

Edit by Tony. I wrapped the config so it will be formatted.

@tony

This comment has been minimized.

Member

tony commented Nov 23, 2013

@lowks My mistake, $ tmux show-w -g pane-base-index.

I am trying out your config now

@tony

This comment has been minimized.

Member

tony commented Nov 23, 2013

@lowks I can confirm the error. Looking into it now.

@tony tony closed this in e9c567a Nov 23, 2013

@tony tony reopened this Nov 23, 2013

@tony

This comment has been minimized.

Member

tony commented Nov 23, 2013

@lowks: Can you try updating to the latest version on pip. Does this work now?

@tony

This comment has been minimized.

Member

tony commented Nov 23, 2013

v0.1.0rc2

$ pip install -U tmuxp to upgrade.

@lowks

This comment has been minimized.

lowks commented Nov 23, 2013

Okay. That was a good fix. Confirmed it works well now. Will move on to try other stuff.

@tony

This comment has been minimized.

Member

tony commented Nov 23, 2013

@lowks I'm happy to see it's working now, that was a good catch.

I will close this issue for now. If anything else pops up. I'm here.

@tony tony closed this Nov 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment