jimeh / tmuxifier

Tmuxify your Tmux. Powerful session, window & pane management for Tmux.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`load-window` command does not honor session_root

TheLonelyGhost opened this issue · comments

I have a predefined tmuxifier session called 'derp' that includes 3 windows and would like to load a 4th on-demand:

# Filename: derp.session.sh
session_root "~/workspace/derp"

if initialize_session "derp"; then
  #1 pane:
  #  - ssh connection to remote server, then connect to screen running an IRC client
  load_window "irc"

  #2 panes:
  #  - vim
  #  - test runner (guard)
  load_window "ruby-editor" # 2 panes: vim, test runner

  # NOTE: commented-out to be run ad-hoc
  # 
  #load_window "rails-server" # 2 panes: 'rails s', 'tail -F log/development.log'

  new_window "misc"

  select_window 2
fi

# Finalize session creation and switch/attach to it.
finalize_and_go_to_session

If you notice, 'rails-server' is commented out since I'm not always working on rails projects. All 3 windows are loaded with the correct session root. When I run tmuxifier load-window rails-server from the 'misc' window, however, it loads it from my home directory.

I expected it to load the session_root directory instead of the home directory.

Originally this used to work by using Tmux's built in support for setting a session root. That feature was removed a while back though, and I opted for a rather quick solution.

I'll try and get it working via some form of environment variable over the weekend.

Latest update should solve this for you. If you have any more issues, please let me know :)

Works great now. Thanks!

Keep up the good work! This is definitely a tool I use every day and, because it's based on bash, has made it into my dotfiles repo. This also helps a lot compared to tmuxinator since I work with a ruby version manager (rbenv or RVM) and try to prevent pollution of my global gemset whenever possible. Now this is not only a full replacement, but much more modular in allowing me to open predefined windows on-the-fly. Seriously, I appreciate it.

Thanks, always great to hear that Tmuxifier is useful :)... And your use-case is identical to my own... lol