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

tmuxPlugins.t-smart-tmux-session-manager: init at 2.8.0 #252214

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

hmajid2301
Copy link
Contributor

@hmajid2301 hmajid2301 commented Aug 29, 2023

Description of changes

A tmux plugin for making session management a lot easier, using zoxide and fzf. https://github.com/joshmedeski/t-smart-tmux-session-manager

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/2835

@bbigras
Copy link
Contributor

bbigras commented Oct 30, 2023

Did you see that there are versions (like v2.6.0) on https://github.com/joshmedeski/t-smart-tmux-session-manager/releases ?

@hmajid2301
Copy link
Contributor Author

i did not 😓, let me fix that :)

@hmajid2301 hmajid2301 force-pushed the add-tmux-t branch 2 times, most recently from 7551c81 to c2ecb5d Compare October 30, 2023 19:57
Copy link
Contributor

@bbigras bbigras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builds and runs fine, thanks!

@hmajid2301
Copy link
Contributor Author

Thank you very much for your review!

@bbigras
Copy link
Contributor

bbigras commented Oct 31, 2023

Do you use the t command when not in tmux?

Something like:

postInstall = ''
  mv $target/bin $out/
'';

It seems other tmux plugins replace fzf and other bins with their full path (in case people don't have them installed). Not all plugins have them though.

maybe something like:

# for the t shell script
wrapProgram $out/bin/t \
        --prefix PATH : ${with pkgs; lib.makeBinPath (
        [ pkgs.fzf pkgs.zoxide ... ]
        )}

# for tmux files
find $target -type f -print0 | xargs -0 sed -i -e 's|fzf |${pkgs.fzf}/bin/fzf |g'
# ...

@bbigras
Copy link
Contributor

bbigras commented Oct 31, 2023

unless maybe the plugin doesn't use zoxide if it's not in PATH.

@hmajid2301
Copy link
Contributor Author

hmajid2301 commented Oct 31, 2023

Do you use the t command when not in tmux?

Yes, outside of tmux it creates a new session (or loads one if it exists)

unless maybe the plugin doesn't use zoxide if it's not in PATH.

I think it needs zoxide and fzf as deps, actually. Will update as
suggested above 🤔!

@hmajid2301
Copy link
Contributor Author

Do we also need to replace zoxide like we did for fzf ?

@bbigras
Copy link
Contributor

bbigras commented Oct 31, 2023

Yes, outside of tmux it creates a new session (or loads one if it exists)

Do you use tmux with home-manager? I think adding t-smart-tmux-session-manager to programs.tmux.plugins didn't add t to my path.

@hmajid2301
Copy link
Contributor Author

I had it setup slightly different:

  t-smart-manager = pkgs.tmuxPlugins.mkTmuxPlugin {
    pluginName = "t-smart-tmux-session-manager";
    version = "unstable-2023-09-20";
    rtpFilePath = "t-smart-tmux-session-manager.tmux";
    src = pkgs.fetchFromGitHub {
      owner = "joshmedeski";
      repo = "t-smart-tmux-session-manager";
      rev = "63360755451a1d536f5847b3a3dc41bb3050b10c";
      sha256 = "00051slyy55qdxf0l41kfw6sr46nm2br31hdkwpy879ia5acligi";
    };
  };

and then:

    programs.fish.shellInit = ''
      fish_add_path ${t-smart-manager}/share/tmux-plugins/t-smart-tmux-session-manager/bin/
    '';

Which is a bit of hack tbh thinking about it.

@hmajid2301
Copy link
Contributor Author

Do you use tmux with home-manager? I think adding t-smart-tmux-session-manager to programs.tmux.plugins didn't add t to my path.

hmm interesting 🤔

@@ -648,6 +648,28 @@ in rec {
inherit mkTmuxPlugin;
};

t-smart-tmux-session-manager = mkTmuxPlugin {
pluginName = "t-smart-tmux-session-manager";
version = "unstable-2023-06-05";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the tag of the latest version? Like

plumb = mkTmuxPlugin rec {
pluginName = "plumb";
version = "0.1.1";
src = fetchFromGitHub {
owner = "eraserhd";
repo = "tmux-plumb";
rev = "v${version}";
sha256 = "1c6k4fdl0az9811r6k164mgd4w5la75xr6x7nabmy046xc0z5i2r";
};
postInstall = ''
sed -i -e 's,9 plumb,${pkgs.plan9port}/bin/9 plumb,' $target/scripts/plumb
'';
};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i made some changes is this whay you meant!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. Thanks.

Do you have hangs with 2.8.0? On my computer it seems to hang when I use ctrl+b + T

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope works fine for me!

@bbigras
Copy link
Contributor

bbigras commented Jan 13, 2024

Can you squash your commits please? Don't forget to replace "init at unstable-2023-06-05" with the right version.

@hmajid2301 hmajid2301 changed the title tmuxPlugins.t-smart-tmux-session-manager: init at 2023-06-05 tmuxPlugins.t-smart-tmux-session-manager: init at 2.8.0 Jan 25, 2024
@hmajid2301
Copy link
Contributor Author

done

@bbigras bbigras merged commit cf020b1 into NixOS:master Jan 26, 2024
25 checks passed
@bbigras
Copy link
Contributor

bbigras commented Jan 26, 2024

Thank you very much for the PR. I have been using this plugin every day since I discovered it.

@hmajid2301 hmajid2301 deleted the add-tmux-t branch March 3, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants