To The Point

The focus problem.

So there is an issue #326 of tmuxp repository that I also found using tmuxp. It's about using focus attribute that does not work.


So first of all I have started installed tmuxp with pipsi with:

pipsi install tmuxp

Then I have found that pipsi actually creates virtualenv to run scripts.

So I've found where actually tmuxp is located with:

which tmuxp

That outputed with:


And found location of the script that should be similar to:


So first I tried to debug how the Tmuxp works internally and looked for focus in code.

I've finally found the tmuxp load uses code with this stack trace :

  • at command_load invokes:
  • at load_workspace then invokes builder class:
  • at from workspacebuilder: - at
  • and in after - invoking set_layout_hook(builder.session, 'client-attached')

After tampering and making printing and tracing down the problem I've found that making sys.exit() after creates tmux session that properly works with focusing.

So after that I narrowed down problem and found that commenting set_layout_hook at fixes problem.

I have created a #371 PR and requested merging to branch. Let's check out what the maintainer has to say about my fix which frankly is more of a hack.



That's it :) Comment, share or don't - up to you.

Any suggestions what I should blog about? Post me a comment in the box below or poke me at Twitter: @anselmos88.

See you in the next episode! Cheers!


comments powered by Disqus