Releases: joshmedeski/t-smart-tmux-session-manager
Make .git optional for cloning
Quick patch to the recent t --clone
feature. The .git
on the git repo is now optional, thanks @tanishqmanuja!
Separator
A separator has been added to distinguish tmux sessions from other results, thanks @TomDeneire!
Git Worktree Support
Thanks to @0xRichardH session naming now supports git worktrees! Now, the git worktree directory will be included in the session name.
Exclude active session
Exclude the current tmux session (if tmux is active), making it easy to switch to the last used session by opening the plugin and hitting enter, thanks @hieulw
Quick Repo Cloning
You can quickly clone a repository to your preferred directory by using the t
command combined with the -r
flag (or --repo
).
t --repo https://github.com/joshmedeski/tmux-list.git
Or, for short
t -r (pbpaste)
See the README for full instructions.
If you want to see me build this feature, you can check out the 🔴 live stream
Downgrading bash to v3
I've gotten half a dozen or more issues related to people not upgrading to bash >= 4. I was able to convert the bash script to be compatible with version 3, which is what most macs ship with. Hopefully this reduces issues!
Thanks to danporterhonor for the help!
p.s. a lesson on open-source projects: Reduce the amount of dependencies when possible!
Startup script (.t)
You can run a startup script when you create a new session. This is useful for running a command when you create a new session, like starting a dev server or automatically opening neovim to begin editing a file.
This works by adding a .t
file to your desired directory. Here is a quick script for bootstrapping that file:
touch .t && chmod +x .t && echo -e '#!/usr/bin/env bash\n' > .t && nvim .t
I like opening Neovim and the find file Telescope prompt to quickly find a file to edit. Here is an example of what I put in many of my projects:
#!/usr/bin/env bash
nvim -c 'Telescope find_files'
So, when you open any project that detects a .t
it will automatically run that script when a session is created.
This feature is in early development so please feel free to give feedback if you have ideas for how to improve on it.
You can watch the live stream were I built this feature live:
🔴 Automating tmux workspaces (live stream)
Customize fzf default results
Shoutout to @jorgebef for the suggestion to overwrite the default results for the fzf script.
By default, t will display tmux sessions and zoxide results by default. You can change this by setting @t-fzf-default-results
variable to your tmux.conf
:
set -g @t-fzf-default-results 'sessions' # show tmux sessions by default
set -g @t-fzf-default-results 'zoxide' # show zoxide results by default
I continue to be impressed by the new ideas the community is helping come up with to create a more customizable experience!
Git Root Fixes
Had to adjust some logic to fix the new git root feature. Now, when selecting an existing session (not starting with a /
) the logic will always use that value to connect to the session.
Git Root Session Names
I LOVE this new solution! I use monorepos a lot and often create tmux sessions in nested folders (especially dotfiles). So this workflow feels polished and super helpful giving me more context on my sessions and makes it easier to get to what I want more accurately.
You may prefer your session names starting from the root of the git repository. This can help with naming conflicts if you have multiple directories with the same name on your machine and make it clear when you have multiple sessions open in the same git repository.
bash
Add the following line to ~/.bashrc
export T_SESSION_USE_GIT_ROOT="true"
zsh
Add the following line to ~/.zshrc
export T_SESSION_USE_GIT_ROOT="true"
fish
Add the following line to ~/.config/fish/conf.d/t.fish
set -Ux T_SESSION_USE_GIT_ROOT true