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

When oh-my-zsh tmux plugin is enabled, the 'tmux' alias will cause my oh-my-tmux .tmux.conf.local to be ignored #12247

Open
mayersj1 opened this issue Mar 1, 2024 · 5 comments
Assignees
Labels
Bug Something isn't working

Comments

@mayersj1
Copy link

mayersj1 commented Mar 1, 2024

Describe the bug

I'm using both .oh-my-zsh and .oh-my-tmux. Without the zsh tmux plugin enabled, all works fine for tmux to parse my .tmux.conf.local from oh-my-tmux. When I have the zsh tmux plugin enabled, the configuration from .tmux.conf.local is completely ignored UNLESS I have ZSH_TMUX_AUTOSTART=true in my .zshrc. Disabling the zsh tmux plugin make everything work as expected.

I did verify that with the tmux plugin enabled if I path to the tmux binary or use any of the aliases that are defined by the tmux EXCEPT for 'tmux', then all works as expected.

Steps to reproduce

  1. Don't the 'tmux' plugin.
  2. Install oh-my-tmux
  3. cp the .tmux/.tmux.conf.local file to the home directory and enable the theme
  4. Exit the shell
  5. Start the shell (just to get everything loaded properly)
  6. Type 'tmux' to start tmux, you should see the theme that is configured in .tmux.conf.local
  7. Enable the oh-my-zsh 'tmux' plugin
  8. source / restart your shell
  9. Type 'tmux' and you'll see that instead of getting the theme as configured in the .tmux.conf.local, you are getting the default green status bar of tmux.
  10. type 'ts' to start with a session and all seems okay.
  11. type 'ta' to attach to the session and all seems okay. Just the 'tmux' command that appears to be broken.

NOTE: If I have ZSH_TMUX_AUTOSTART=true in my .zshrc, then the proper theme is loaded from the .tmux.conf.local file as well.

Expected behavior

use of oh-my-tmux should be unaffected by the zsh tmux plugin

Screenshots and recordings

No response

OS / Linux distribution

MacOS Sonoma

Zsh version

5.9

Oh My Zsh version

master (0008534)

Terminal emulator

kitty, iTerm2

If using WSL on Windows, which version of WSL

None

Additional context

No response

@mayersj1 mayersj1 added the Bug Something isn't working label Mar 1, 2024
@carlosala
Copy link
Member

I'm not sure I can follow what's going on here. ZSH_TMUX_AUTOSTART just executes the tmux alias at startup, which shouldn't be different than executing it manually right after.
Could you make sure that you have the exact configuration that https://github.com/gpakosz/.tmux proposes?

@carlosala carlosala self-assigned this Mar 3, 2024
@carlosala
Copy link
Member

Hi! Is it still reproducible?
friendly ping @mayersj1 :)

@mayersj1
Copy link
Author

mayersj1 commented Apr 9, 2024 via email

@carlosala
Copy link
Member

I'm not sure I can follow what's going on here. ZSH_TMUX_AUTOSTART just executes the tmux alias at startup, which shouldn't be different than executing it manually right after.
Could you make sure that you have the exact configuration that https://github.com/gpakosz/.tmux proposes?

Could you check this?

@mayersj1
Copy link
Author

mayersj1 commented Apr 10, 2024

So, the configuration is exactly as noted in the .tmux link provided above.

With ZSH_TMUX_AUTOSTART (which I have disabled as it was causing other, unrelated issues) all seemed to load fine. That doesn't negate the fact that now, if I have the tmux plugin enabled, launching 'tmux' causes the .tmux.conf.local to be completely ignored. If I use the 'tmux' command (which is an alias at this point: _zsh_tmux_plugin_run) it skips the .tmux.conf.local.

If I directly call the tmux executable or use a function that wraps tmux, all works properly (such as 'ts'):

 which ts
ts () {
        if [[ -z $1 ]] || [[ ${1:0:1} == '-' ]]
        then
                tmux new-session "$@"
        else
                tmux new-session -s "$@"
        fi
}

executing 'tmux' with any argument works properly of course. It's just the bare 'tmux' execution that seems to launch the tmux session without parsing the .tmux.conf.local file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants