tmux-toggle-popup icon indicating copy to clipboard operation
tmux-toggle-popup copied to clipboard

🌀 A handy plugin to create toggleable popups

🌀 tmux-toggle-popup

A handy plugin to create toggleable popups.

tmux-toggle-popup.webm

Information

📦 Installation

Requirements

  • tmux >= 3.4 (not tested on earlier versions)
  • Bash >= 3.2.57

[!NOTE]

This plugin has been tested on macOS's built-in Bash through GitHub Actions. However, if you are experiencing issues on macOS, please try upgrading your Bash to a newer version or open an issue.

With tmux Plugin Manager (recommended)

Add this plugin to the list of TPM plugins in .tmux.conf:

set -g @plugin "loichyan/tmux-toggle-popup"

Manual installation

Clone the repo:

git clone https://github.com/loichyan/tmux-toggle-popup ~/clone/path

Add this line to the bottom of .tmux.conf:

run ~/clone/path/toggle-popup.tmux

Reload tmux environment with: tmux source ~/.tmux.conf. You should now be able to use this plugin.

Nix (Home Manager)

config.programs.tmux = {
  enable = true;

  # ...

  plugins = with pkgs; [
    tmuxPlugins.tmux-toggle-popup
    # ...
  ];

  extraConfig = ''
    ...
    # popups
    bind C-t run "#{@popup-toggle} -Ed'#{pane_current_path}' -w75% -h75%"
    bind C-g run "#{@popup-toggle} -Ed'#{pane_current_path}' -w90% -h90% --name=lazygit lazygit"
    ...
  '';
};

🚗 Quick start

Create keybindings to toggle your default shell and lazygit:

bind -n M-t run "#{@popup-toggle} -w75% -h75% -Ed'{popup_caller_pane_path}'"
bind -n M-g run "#{@popup-toggle} -w90% -h90% -Ed'{popup_caller_pane_path}' --name=lazygit lazygit"

# Turn on autostart to boost the first call of @popup-toggle.
set -g  @popup-autostart on
# If you prefer to share popups within the same project, regardless of which
# session you are working in, put the following setting to your `.tmux.conf`.
set -gF @popup-id-format "#{b:pane_current_path}/{popup_name}"

# If you are using tmux-continuum, make sure it is loaded before this plugin.
# This is only required when you enable @popup-autostart.
set -g @plugin "tmux-plugins/tmux-continuum"
# Must be loaded after tmux-continuum, as the autostart of popup server can
# disable the autosave of tmux-continuum.
set -g @plugin "loichyan/tmux-toggle-popup"

[!TIP]

Whenever you update the .tmux.conf, remember to reload it in both your working session and the popup session; otherwise, keybinding or style changes may not reflect in popup sessions.

For more information please check out the usage.

⚖️ License

Licensed under either of

at your option.