omerxx / tmux-sessionx

A Tmux session manager, with preview, fuzzy finding, and MORE
GNU General Public License v3.0
688 stars 61 forks source link

Error: preview.sh Missing in tmux-sessionx Plugin When Using Nix Configuration #132

Open Qubut opened 1 month ago

Qubut commented 1 month ago

I recently attempted to set up tmux using a Nix configuration file, incorporating several plugins, including the Catppuccin theme and your tmux-sessionx plugin. While most of the plugins appear to load successfully, I encountered an error specifically related to the tmux-sessionx plugin.

Below is the relevant portion of my Nix configuration:

{ config, pkgs, lib, fetchFromGitHub, ... }:
let
  mkTmuxPlugin = pkgs.tmuxPlugins.mkTmuxPlugin;
  tmux-sessionx = mkTmuxPlugin {
    pluginName = "sessionx";
    version = "unstable-2024-08-16";
    src = pkgs.fetchFromGitHub {
      owner = "omerxx";
      repo = "tmux-sessionx";
      rev = "ecc926e7db7761bfbd798cd8f10043e4fb1b83ba";
      sha256 = "1qa2a4m75w6k64f52fsw9k6yyiidlxm2q31w8hrsjd5bcdr6dzab";
    };
  };

  tmux-fzf-url = mkTmuxPlugin {
    pluginName = "tmux-fzf-url";
    version = "stable-2024-08-16";
    src = pkgs.fetchFromGitHub {
      owner = "junegunn";
      repo = "tmux-fzf-url";
      rev = "dc701c41cfd32de0c8271c203d5e91875330320c";
      sha256 = "0miaq053x82ps7v55by28wzbwd6fm59ambzm4l10yk2cgw3ij99y";
    };
  };
  tmux-fzf = mkTmuxPlugin {
    pluginName = "tmux-fzf";
    version = "stable-2024-08-16";
    src = pkgs.fetchFromGitHub {
      owner = "sainnhe";
      repo = "tmux-fzf";
      rev = "1547f18083ead1b235680aa5f98427ccaf5beb21";
      sha256 = "10yhv9blamy3ha3lljz96s84y064dxs627xpwckd10n4vspszjkl";
    };
  };
in
{
  programs.tmux = {
    enable = true;
    clock24 = true;
    baseIndex = 1;
    plugins = with pkgs.tmuxPlugins; [
      better-mouse-mode
      yank
      resurrect
      continuum
    ];
    extraConfig = ''
      set -g default-terminal "tmux-256color"
      set -g renumber-windows on
      setw -g mode-keys vi
      set -g pane-active-border-style 'fg=magenta,bg=default'
      set -g pane-border-style 'fg=brightblack,bg=default' 
      run-shell ${tmux-fzf}/share/tmux-plugins/tmux-fzf/main.tmux
      run-shell ${tmux-fzf-url}/share/tmux-plugins/tmux-fzf-url/fzf-url.tmux
      set -g @catppuccin_window_left_separator ""
      set -g @catppuccin_window_right_separator " "
      set -g @catppuccin_window_middle_separator " █"
      set -g @catppuccin_window_number_position "right"
      set -g @catppuccin_window_default_fill "number"
      set -g @catppuccin_window_default_text "#W"
      set -g @catppuccin_window_current_fill "number"
      set -g @catppuccin_window_current_text "#W#{?window_zoomed_flag,(),}"
      set -g @catppuccin_status_modules_right "directory meetings date_time"
      set -g @catppuccin_status_modules_left "session"
      set -g @catppuccin_status_left_separator  " "
      set -g @catppuccin_status_right_separator " "
      set -g @catppuccin_status_right_separator_inverse "no"
      set -g @catppuccin_status_fill "icon"
      set -g @catppuccin_status_connect_separator "no"
      set -g @catppuccin_directory_text "#{b:pane_current_path}"
      run-shell ${pkgs.tmuxPlugins.catppuccin}/share/tmux-plugins/catppuccin/catppuccin.tmux
      run-shell ${tmux-sessionx}/share/tmux-plugins/sessionx/sessionx.tmux
    '';
  };
}

Despite this setup, an error persists, originating from the tmux-sessionx plugin itself. I have attached a screenshot showing the error message for further clarity.

Error Screenshot

I would appreciate any assistance or guidance on resolving this issue. Thank you for your support!

adriangitvitz commented 1 week ago

I had to modify the sessionx.sh file to specify the TMUX_PLUGIN_MANAGER_PATH variable to point to the location of my tmux plugins