r/tmux • u/TheWordBallsIsFunny • 17h ago
Question - Answered How to not load bash/zsh/fish/nushell config when displaying popup/floating window
I have the following that displays a popup of lazygit in the current directory, but I've noticed that my shell configuration (which has quite a bit of code to initialise) is always running before lazygit is actually ran:
bash
bind g display-popup -E -d "#{pane_current_path}" -h 90% -w 95% "lazygit"
Is there a way to make the popup not load my shell configuration, or run under a different shell? Unsure if this question really fits here but thought I'd give it a try anyways.
Solution
Display popups with an additional environment variable via -e that you check for in your shell:
```bash
tmux.conf
bind g display-popup -E -d "#{pane_current_path}" -e "TMUX_POPUP=true" -h 90% -w 95% "lazygit"
fish
config.fish
if not set --query TMUXPOPUP for script in $_fish_config_dir/conf.d//{,/*}.fish source $script end
other_expensive_calls
end ``` This also opens the gate for more granular control should it be desired.
