Giter Site home page Giter Site logo

t-smart-tmux-session-manager's Introduction

Introducing Sesh πŸŽ‰

I've rewritten this project in Go and called it "sesh". It's more flexible and faster than the original script. I'm no longer maintaining this project. I'll leave it up for historical purposes, but I recommend you check out the new project.

Check out sesh

t - the smart tmux session manager

tmux is a powerful tool, but dealing with sessions can be painful. This script makes it easy to create and switch tmux sessions:

Documentation

Prerequisites

Note: some users have had issues with fzf integration on tmux 3.2a where upon spawning fzf it would lock the tmux pane. Upgrading to 3.3a seems to be a viable workaround Check #104

brew install tmux zoxide fzf

Use the package manager of your OS if you are not on macOS.

How to install

1. Install tpm plugin

Add the following line to your tmux.conf file:

set -g @plugin 'joshmedeski/t-smart-tmux-session-manager'

Note: tpm recommends you list your plugins and then run tpm at the very bottom of your tmux.conf.

Then, run <prefix>I to install the plugin.

2. Add to path

To use the t script from anywhere, select your shell environment and follow the instructions.

Note: you'll need to check the path of your tpm plugins. It may be ~/.tmux/plugins or ~/.config/tmux/plugins depending on where your tmux.conf is located.

bash

Add the following line to ~/.bashrc

# ~/.tmux/plugins
export PATH=$HOME/.tmux/plugins/t-smart-tmux-session-manager/bin:$PATH
# ~/.config/tmux/plugins
export PATH=$HOME/.config/tmux/plugins/t-smart-tmux-session-manager/bin:$PATH
zsh

Add the following line to ~/.zprofile

# ~/.tmux/plugins
export PATH=$HOME/.tmux/plugins/t-smart-tmux-session-manager/bin:$PATH
# ~/.config/tmux/plugins
export PATH=$HOME/.config/tmux/plugins/t-smart-tmux-session-manager/bin:$PATH
fish

Add the following line to ~/.config/fish/config.fish

# ~/.tmux/plugins
fish_add_path $HOME/.tmux/plugins/t-smart-tmux-session-manager/bin
# ~/.config/tmux/plugins
fish_add_path $HOME/.config/tmux/plugins/t-smart-tmux-session-manager/bin

3. Recommended tmux settings

I recommend you add these settings to your tmux.conf to have a better experience with this plugin.

bind-key x kill-pane # skip "kill-pane 1? (y/n)" prompt
set -g detach-on-destroy off  # don't exit from tmux when closing a session

4. Customize Prompt (optional)

If your terminal supports Nerd Font symbols, you can customize your prompt.

set -g @t-fzf-prompt '  '

Or you can replace the prompt with anything you'd like.

How to use

  Run interactive mode
      t
        ctrl-s list only tmux sessions
        ctrl-x list only zoxide results
        ctrl-f list results from the find command

  Go to session (matches tmux session, zoxide result, or directory)
      t {name}

  Open popup (while in tmux)
      <prefix>+T
        ctrl-s list only tmux sessions
        ctrl-x list only zoxide results
        ctrl-f list results from the find command

  Show help
      t -h
      t --help

By default, this plugin is bound to <prefix>+T which triggers a fzf-tmux popup that display zoxide results. Type the result you want and when you hit enter it will create a tmux session and connect to it or, if the sessions already exists, switch to it.

If you are not in tmux, you can simply run t to start the interactive script, or call t {name} to jump directly to a session of your choosing.

Key Bindings

  • ctrl-s list only tmux sessions
  • ctrl-x list only zoxide results
  • ctrl-f find by directory

Extra features

Cloning repositories

You can quickly clone a repository to your preferred directory by using the t command combined with the -r flag (or --repo).

First, you have to set the T_REPOS_DIR variable in your shell environment. Make sure to set it where you want your repositories cloned.

bash

Add the following line to ~/.bashrc

export T_REPOS_DIR="~/repos"
zsh

Add the following line to ~/.zshrc

export T_REPOS_DIR="~/repos"
fish

Add the following line to ~/.config/fish/conf.d/t.fish

set -Ux T_REPOS_DIR ~/repos

In order to use the feature, simply run:

t -r https://github.com/joshmedeski/t-smart-tmux-session-manager.git

Note: it has to be a valid git remote url (ending in .git) or order to work.

I prefer to copy the repository URL to my clipboard and run the following command on macOS.

bash/zsh
t -r $(pbpaste)
fish
t -r (pbpaste)

If you want to overwrite the directory to clone to, you can overwrite the T_REPOS_DIR variable before running the command:

T_REPOS_DIR=~/code t --repo https://github.com/joshmedeski/tmux-list.git

How to customize

Use Git Root for session name

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

Include parent dir in session name

You may prefer your session names having a prefix of the parent directory. This can help with naming conflicts if you have multiple directories with the same name on your machine.

bash

Add the following line to ~/.bashrc

export T_SESSION_NAME_INCLUDE_PARENT="true"
zsh

Add the following line to ~/.zshrc

export T_SESSION_NAME_INCLUDE_PARENT="true"
fish

Add the following line to ~/.config/fish/conf.d/t.fish

set -Ux T_SESSION_NAME_INCLUDE_PARENT true

Custom fzf-tmux keybinding

By default, the t popup is bound to <prefix>T. In order to overwrite your own custom key binding, add setting the @t-bind varaible to your tmux.conf:

set -g @t-bind "K"

You can unbind the default by using none.

set -g @t-bind "none" # unbind default

Change default fzf results

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

Custom find command

By default, the find key binding (^f) will run a simple find command to search for directories in and around your home directory.

find ~ -maxdepth 3 -type d

You can customize this command by setting @t-find-binding variable to your tmux.conf:

In this example, I'm setting the prompt with a custom Nerd Font icon and using fd to search directories (including hidden ones) up to two levels deep from my home directory.

set -g @t-fzf-find-binding 'ctrl-f:change-prompt(  )+reload(fd -H -d 2 -t d . ~)'

Run man fzf to learn more about how to customize key bindings with fzf.

FZF_TMUX_OPTS

If you want to overwrite the fzf-tmux options, you can set the FZF_TMUX_OPTS variable in your shell environment.

# ~/.bashrc or ~/.zshrc
export FZF_TMUX_OPTS="-p 55%,60%"
# ~/.config/fish/config.fish
set -Ux FZF_TMUX_OPTS "-p 55%,60%"

Run man fzf-tmux to learn more about the available options.

Custom Border Label

If you want to customize the fzf popup border label, you can add T_FZF_BORDER_LABEL to your shell variable

# ~/.bashrc or ~/.zshrc
export T_FZF_BORDER_LABEL=' Your Custom Label '

or if you use fish:

# ~/.config/fish/config.fish
set -Ux T_FZF_BORDER_LABEL " Your Custom Label "

Background

Interested in learning more about how this script came to be? Check out Smart tmux sessions with zoxide and fzf. ]

Startup script

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.

Bonus: macOS keyboard shortcut

My personal workflow uses macOS Keyboard Shortcuts for tmux. I have bound the t popup to cmd+j with the following code:

Alacritty

Add the following line to your alacritty.yml

key_bindings:
  - { key: K, mods: Command, chars: "\x02\x54" } # open t - tmux smart session manager
Kitty

Add the following line to your kitty.conf

map cmd+k send_text all \x02\x54
WezTerm

Add the following line to your wezterm.lua inside the keys options

{ key = 'j', mods = 'CMD', action = wezterm.action.SendString '\x02\x54' }, -- open t - tmux smart session manager

Note: These bindings are based off the default prefix, ctrl+b (which converts to \x02). If you changed your prefix, I recommend watching my video which goes into depth how to customize your own keybindings in Alacritty.

t-smart-tmux-session-manager's People

Contributors

0xrichardh avatar danielvoogsgerd avatar danielx avatar dlvhdr avatar erdivartanovich avatar fredrikaverpil avatar guillenotfound avatar hieulw avatar joshmedeski avatar kirkeasterson avatar msouza91 avatar otard95 avatar rodrigore avatar tanishqmanuja avatar thesast avatar tomdeneire avatar vitorf7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

t-smart-tmux-session-manager's Issues

Preview Support

As a user, I want to preview my sessions and projects, so I can get a high level view of my sessions and projects.

See #79 for more references.

Feature request: allow paths zoxide doesn't know

First, I love the workflow that inspired this plugin. It's so simple while remaining super powerful.

I sometimes want to start a session for a dir that I've just now created or that zoxide doesn't yet know for some reason, and it'd be a nice if there was an option to treat the string in the input as a path to open a session for if there are no results from the fzf filter.

So, for example, if I want to create a session for a bar project, which I haven't visited in months and is no longer in the zoxide query output. I type /Users/foo/repos/bar/ and there are no results, it'd be nice if the plugin checked if the path exists and is a directory, and then open a session for it.

The --print-query option of fzf can be used for that, and if you like the idea, I'd be happy to implement it and send a PR

Prioritize zoxide results by score

As a user, I want my fzf results to sort zoxide results prioritized by their score.

  • Currently sorts in a random order when calling zoxide query -l
  • Even if displaying the score with zoxide query -ls the score values aren't prioritized when filtering down with fzf.

tmux session names by git root

As a user, I want sessions to be named by the root of a git repo (when possible).

Examples

  • monorepo/packages/package-name
  • dotfiles/.config/fish

Notes

I have to figure out the best way to determine if a folder is in a git directory and then use the root folder to help drive the name of the session.

This is in conflict with the new feature I just created to allow the parent directory, so I'll want to make sure they don't clash.

Like that feature, I'll create some opt-in variable that adds support for this feature.

feature request: alias $HOME as ~ for zoxide results

Thanks for building this, i love how it simplifies my workflow!

Though on my work computer i am forced to use my email as the username which makes the home path quite long.

I don't have the need for the entire $HOME path so i'd prefer to have that aliased as '~'

t command not found!

iI have done everything the documentation mentions, yet the t command is not found by zsh. The T command works as intended though.

t is too short - probably a better name is needed

Currently I'm using 't' as an alias to task warrior task command.

I understand that probably it is very useful to use t as the command, but probably it would be preferred to give the bash script a more descriptive name like:

bin/smart-tmux-session-manager

and setting it to t could be done via an alias in the shell config file. (So you can set it to 't' or anything else actually

Add unit tests

As a developer, I want to add unit tests to the project, so I can prevent regressions in future development and make sure edge cases are covered as intented.

Potential Unit Testing Solutions

Ideas

  • Use nix to build dependencies?
  • Create GitHub action(s)
  • Make sure to include different operating systems and versions of dependencies (tmux, fzf, etc...)
  • Make sure to assert each shell configuration (bash, zsh, fish)
  • Make sure to assert all features in each tmux state (serverless, detached, attached)
  • Maybe get started with a simple hello world test and action

Improve session name

Hi @joshmedeski,

I've been using the t script a lot lately and I'm really liking it! Thanks.

One thing I've noticed though is that I'd like the tmux session name to be a bit more descriptive than just the basename of the selected directory. Often I'm in a directory that is called "application" or "python" or "code" or "bin" and that's not really helpful in the list of sessions. Sometimes I even have duplicate names because of this.

As an experiment I've replace line 170:

SESSION_NAME=$(echo "$FOLDER" | tr ' .:' '_')

with

SESSION_NAME=$(echo $RESULT| tr ' .:' '_' | awk -F "/" '{print $(NF-1)"/"$NF}')

which gives you just one more directory, hence I get things like "docstore/application", "csvtool/python", or "projects/code".

Do you feel this might be something you could include in the t-script as a a feature?

As a side note: ideally you'd like to customize stuff like this, but also other things like the window header and such. On the other hand, I like that t is just one plain bash script and that it's ready to go zero config!

Failed to open a new tmux session

> t
/Users/user/.tmux/plugins/t-smart-tmux-session-manager/bin/t: line 181: syntax error near unexpected token `;'
/Users/user/.tmux/plugins/t-smart-tmux-session-manager/bin/t: line 181: `detached) ;&'

Recently installed it on my M2 machine, using zsh. Typing t, search feature works. However after selecting one of the directory, I'm getting this error. πŸ€”

hangs until I restart my terminal and re-attach tmux

When I invoke t-smart-tmux-session-manager, it opens, shows the sessions but hangs for a reason.

I can "fix" it by restarting my terminal and re-attaching tmux.

This might have happened after a t-smart-tmux-session-manager update. Not sure yet. I'll try to find out.

I tried with foot and alacritty. and I tried disabling all my other tmux plugins.

zsh

Runtype Refactor

I'd suggest you make a new issue outlining the areas you want to refactor and we can discuss it. I realize the script is procedural but it has come a long way since it was originally published.

Originally posted by @joshmedeski in #28 (comment)


The refactor would consist in moving the checks for how t was run to the very start.
This would be stored in a variable to then be easily switch-cased on for extra readability.
With this the script could also correctly show which binding should be used to invoke it in Tmux inside the help page if it is different from default.

Starting t from inside a Tmux Session locks the pane

I just installed the extension in an attempt at a better workflow outside vim in which I am currently using tmux-sessionizer, I have the binaries on path, but when it tries to start fzf-tmux it is locking up, I am assuming that it is when it gets to that part because it was not finiding that tool before because I had a minimal install of fzf, so I updated with the git install script using --all and when I tried to open the pop-up from inside a session the pane crashes with no input to shell. I can open a new pane and kill the previous one, but got me tripped up.

Sorry for the recording format, I got to figure out how to select the screen for the ffmpeg recording yet. But you should be able to see the issue.
https://github.com/joshmedeski/t-smart-tmux-session-manager/assets/19522556/0ce425b8-c104-4ba9-a2d4-1e0dd343bfad

tmux-client-364682.log
tmux-server-364684.log

Add "show all" fzf binding (^a)

  • Add ^a when filtering by the find, session, or zoxide command
    • Make sure to cover all edge cases!
  • Update help text
  • Update README.md

Keybinds not working

Hello. Ever since I've updated the plugin, I'm finding that the keybind won't work anymore. C-b T does not bring up the tmux-popup. I can call t directly which works fine. Doing so via keybind does not work. Do you have any ideas as to what's happening?

How to bind the popup without prefix key

sorry if this a silly question. I'm new to tmux in general πŸ˜…

The provided variable config set -g @t-bind "K" can be only used to bind the popup to bind-key meaning I have to press <prefix>@t-bind.

I would like to bind it to something like M-o(M=Alt). How could I do that?

getting error since last update

/Users/ali/.tmux/plugins/t-smart-tmux-session-manager/bin/t: line 53: cd: ~/Desktop/projects/joshuto: No such file or directory

But i can see that this directory exist in the given path.

`fzf-tmux -p` requires tmux >= 3.2

Hi Josh,

Thanks for the great work here on this plugin. I just wanted to let you know of a small issue I've found:

Problem:

It seems as if tmux >= 3.2 is required to make things work as is with t.sh. As of right now I encounter problems with any fzf-tmux command that has a -p flag inside of tmux 3.0a. This in short causes nothing to happen when running t.sh from it's tmux binding while inside of tmux < 3.2 and things lock up. A simple solution might be specifying that tmux >= 3.2 is needed on the "Prerequisites' section of the README.md. I'm happy to contribute that if this is a reproducible problem.

Workaround:

if fzf-tmux can't use the popup, and one is using tmux <3 .2, then the run-shell command should be run with the -b flag on the following line:
https://github.com/joshmedeski/t-smart-tmux-session-manager/blob/main/t-smart-tmux-session-manager.tmux#L14

Environment Details:

tmux 3.0a
fzf 0.35.1
Shell: zsh 5.8
OS: Ubuntu 20.04.6 LTS on Windows 10 x86_64

References:
https://raw.githubusercontent.com/tmux/tmux/3.2/CHANGES
https://github.com/junegunn/fzf/blob/master/ADVANCED.md#popup-window-support

Best,
Another Josh

Make the previously active session selected by default

Hey Josh,

Following up on our chat on Discord πŸ˜„

As a user, I'd like to be able to mindlessly switch to the previously active session by bringing up the t prompt and hitting enter. In order to do this, it would probably make sense to remove the current session from the prompt.

The reason I think this would be nice is that I've been finding it hard to keep track of all of my keybindings, and one that I've been finding particularly problematic is "switch to the previously active session" (cmd + l) vs. t (cmd + k). By condensing this into one keybinding, I can either quickly switch to the previous session or opt for doing something else, whether it's creating a new session or switching to another session.

I don't know that everyone would love this, so perhaps it could be an opt-in sort of feature.

Joe

Rewrite

The project has grown a lot in the last year! πŸŽ‰

I think it is time to move the project away from a single file and into a more structured project.

Requirements

Here are the requirements for the refactor:

  • Compile to a cli binary
  • Accept CLI arguments for subcommands and flags
  • Break up the code into modules
  • Allow for easy testing of the code
  • Allow for easy debugging of the code
  • Introduce a proper design pattern for continued growth
  • Centralized configuration pattern (yml or toml?)

Stretch Goals

Here are some stretch goals for the refactor:

  • Make the project session-manager agnostic (i.e. allow for multiple session managers like tmux, WezTerm, Alacritty, Zellij, etc...)
    • My inspiration here is what TanStack is doing with his web libraries by making them agnostic to the web framework you are using and then a thin layer of implementation for each framework.
  • Support multiple shells (i.e. bash, zsh, fish, etc...) for auto-complete and other shell specific features
  • Move to Homebrew for installation (and other package managers like Scoop, Chocolatey, etc...)
  • Support additional interactive commandline fuzzy finder tools
  • TUI for more interactive features (viewing sessions, managing settings)

Contendors

Go

Go is known for its simplicity and speed. It's a great language for writing CLIs and web servers. It's also a very popular language for writing developer tools as well.

Go was designed with simplicity in mind. Developers often refer to it as a β€œboring” language, which is to say that its limited set of built-in features makes Go easy to adopt.

After researching, it seems clear that GoLang is going to be a great fit.

  • Simple to write
  • Great CLI libraries

Rust

My first impression here is to move to Rust. It's a beloved language and so many of the popular developer tools and popular CLIs today are written in Rust.

A close second would be Go, so there will be some exploring before I make a decision and begin the refactor.

  • https://rust-cli.github.io/book/index.html
    • I don't LOVE the syntax and legibility of Rust as someone who hasn't written a line of it before, so there would be some trust in the community's love for this language as an outsider.

Lua

Lua is next on the list. It's a simple language as well and used by NeoVim which is very popoular in this community.

unknown action: change-prompt(directory> )

Hi Josh

Getting error if I try to run script in interactive mode but just typing 't' -> unknown action: change-prompt(directory> ).
I'm using fish but this message I got using bash and zsh too.

Commands on tmux sessions

Add the following commands when filtering by tmux sessions (^s)

  • ^d delete session (and reload existing sessions)
  • Handle if you delete the session you're currently in (reopen tmux?)
  • ^v toggle preview? (similar to the <prefix>s command "Select a new session for the attached client interactively.")

Update binding on help command

As a user, if I change the default binding for the t script, I want the new binding to be reflect in the help command.

Integrate with workspace mangers

There are many tmux workspace manager (see awesome-tmux).

I want to integrate this plugin with those tools, so when you choose a session it can detect your workspace manager and load the correct windows and panes automatically.

I think this will be a huge productivity boost! I'll leave it to the community to help me integrate with multiple workspace managers but I'll start with create an abstract layer that can offer multiple implementations through one entry point on this plugin.

I haven't used any tmux workspace managers consistently so I'll be experimenting and would love feedback from you for which ones you use so I can begin adding integrations.

Configuration Concept

As a user, I want to configure my favorite tmux session manager, so I can automate the creation of projects and boost my productivity.

This will need to be a shell variable, so that it always works even if tmux isn't running yet.

T_WORKSPACE_MANAGER="tmuxinator"

My initial thought is to create a factory for choosing which workspace manager you want to use and, for now, only accept one at a time (maybe we could add a "smart" detector later, but I think that will complicate things).

Then, on selection, rather than just creating a sessions and switching to it, I can create a sort of optional middleware operation that can compose a workspace before attaching.

Please share your thoughts here and let me know what workspace manager to prioritize!

Add ^x when in Serverless mode

Thank you so much for this plugin. While I was starting to use it I was outside of a running tmux server which according to the code it seems you call it serverless mode.

I can see that the initial listing seems to be the zoxide results, once you click on ^f in order to invoke the FZF Find you get the find results, however, you can no longer go back to the zoxide results if you wanted to.
While I don't know how much of an edge case this is I would suggest we could potentially add the ^x Zoxide bind to the serverless mode as well.

Consdier adding version requirement

Thank you for this lovely utility.

I had some trouble getting the session manager overlay to work, after looking at the implementation it turned out that i had an old version of fzf. The argument --border-label was added in [email protected] and was the reason the session manager overlay wasn't working for me. The thing is that it closes immediately so it can be a bit tricky to figure out.

What do you think about adding a version requirement to the README?

Can I bind the command to unprefixed Control-Space?

Here is how I set the bindings for the plugin. It works

set -g @plugin 'joshmedeski/t-smart-tmux-session-manager'
set -g @t-bind "none" # unbind default
set -g @t-bind "Space"

How can I bind the command to unprefixed Ctrl-Space?

Thanks for a great plugin!

feature request: exlude paths for already open sessions

Hello, one thing i've been thinking about is the double entries of open sessions and their zoxide paths.

Did some research and by using this tmux query one can get the tmux sessions base paths:

$ tmux list-sessions -F '#{session_path}'
/Users/daniel/.dotfiles
/Users/daniel/projects/hex
/Users/daniel/.dotfiles/tmux/plugins/t-smart-tmux-session-manager
...

tmux manual says

session_path                    Working directory of session

So i assume that should be stable over a session.

I was thinking that some logic could be added (not sure how yet) to exclude the zoxide entries that already have sessions open.

Improve find command

  • Bind to ^f (for "find")
  • Add tmux option to define your own find command
  • Simplify to just a basic find command (and drop fd support all together in favor of an overwrite).
  • Allow find command prompt icon to be overwritten (custom prompt)
  • Update help text to explain changes
  • Update README.md to explain changes

Creates but can't switch to session

I just updated all my tmux plugins, and I'm now having trouble switching sessions.

When I select something from the zoxide menu, it creates the session, but has trouble switching to it and throws the following error:

'/Users/user/.config/tmux/plugins/t-smart-tmux-session-manager/bin/t' returned 2

This could be a problem with my own config though. I've tried uninstalling all my plugins and reinstalling only this one, but the issue seems to persist.

Any ideas what could be causing this?
Many thanks.

FZF_TMUX_OPTS Support

Add support for FZF_TMUX_OPTS to customize the fzf-tmux to your liking.

  • Check for FZF_TMUX_OPTS when running script and use if found
  • Add fallback -p if FZF_TMUX_OPTS is not found
  • Update README to describe how it prioritizes FZF_TMUX_OPTS

Keybinding to remove zoxide entries

As a user, I want to be able to clean up zoxide results, so I can be more productive and only see what I need when using the session manager.

  • Bind to ctrl-backspace?
  • Make sure to reload results after deleting
  • Allow multi-select to be more efficient with the deletion via control-c for "cleanup"?

Tmux Sessions not found

When starting t-smart zoxide, fd work perfect!!! However, tmux sessions just hangs and finds no results. I have updated to the latest versions of all required packages and my fish shell. I did manage to get sessions however by setting sessions as the default search with the following.

set -g @t-fzf-default-results 'sessions' 

Hope this helps someone else.

Update
After using the tool some more the above code does work, but only if you don't navigate to any of the other searches, zoxide, or fd. If you return to sessions after viewing any of the other search options, no sessions are displayed like when T-smart** first loaded**. For clarity sessions works on first load only works if set as default and no other searches are performed.

Quick Repo Cloning

As a developer, I want to quickly clone a repo and start a tmux session under that new project so that I can start working on my projects quickly!

Ideas

  • Create a -r flag that accepts a GitHub URL or username/repo string (t -r joshmedeski/t-smart-session-manager)
  • Add a config flag that tells me what directory to clone it to (use new yml config?)

Unknown option: --border-label

Unknown option: --border-label

I am using tmux 3.3a, and getting above error when running t without args.

Environment:
Ubuntu on wsl

Crashes if no FZF_TMUX_OPTS set

If there are no FZF_TMUX_OPTS set then t crashes with the following output

[...]/bin/t: line 142: conditional binary operator expected
[...]/bin/t: line 142: syntax error near `$FZF_TMUX_OPTS'
[...]/bin/t: line 142: `                if [[ ! -v $FZF_TMUX_OPTS ]]; then'

Don't we want to be setting -z to check if FZF_TMUX_OPTS is unset, and if it is we give it a default value? Whereas right now we're checking if it is set, and then overwriting it if it is?

Happy to make a PR to this effect

fzf customization

As a user, I want to overwrite fzf options so I can customize this plugin to my liking.

  • Allow user to set variable to overwrite fzf options on this script (ex: FZF_CTRL_R_OPTS)
  • Test overwrites work as expected (border overwrite, prompt overwrite, keybinding overwrites)
  • Merge all fzf related overwrites to one variable
  • Update docs to reflect updates.

Create a check health command

As a user, I want to know if my system is ready to use the t script, so I don't have to submit an issue for development (#46 (comment))

  • Create a --check-health / -c flag that checks all the prerequisites
  • Find a way to have it auto-run on install (post-install script for tpm?)
  • Add a GitHub issue template telling people to run this command before submitting the ticket (and paste the results)
  • Check if the t script is added to the path
  • Check every prerequisite version is matching

Migrate tmux configuration to shell

As a user, I want all my configuration to be set on the shell, in once place, to make it easy to organize and leverage all features wether tmux is running or not.

  • Migrate all tmux configuration values to the shell
  • Update the README (and consolidate overall structure)
  • Make an announcement for the breaking change (find a way to cache the fact it's been viewed?)

Cannot use t to jump to another session

I literally just updated all the tmux plugins in a while and i'm getting this error now πŸ˜…

when i run /Users/kevinrobayna/.config/tmux/plugins/t-smart-tmux-session-manager/bin/t it exits with error 2 and this is the output

 /Users/kevinrobayna/.config/tmux/plugins/t-smart-tmux-session-manager/bin/t
/Users/kevinrobayna/.config/tmux/plugins/t-smart-tmux-session-manager/bin/t: line 119: conditional binary operator expected
/Users/kevinrobayna/.config/tmux/plugins/t-smart-tmux-session-manager/bin/t: line 119: syntax error near `$FZF_TMUX_OPTS'
/Users/kevinrobayna/.config/tmux/plugins/t-smart-tmux-session-manager/bin/t: line 119: `                if [[ ! -v $FZF_TMUX_OPTS ]]; then'

my shell Shell: zsh 5.9

Tmux Pop-up Failing

After updating, t is not launching the pop-up within Tmux - I updated the plugin itself at the same time as all my brew packages, so unsure which caused this issue (mistake). This issue manifests on both my SIP disabled M2 Mac Mini and my heavily locked down work M2 MBP, though both are running the same plugins and dotfiles.

I have <prefix> T bound to cmd J as per your suggestion in the initial video, but now I just see the cursor flicker in the middle of the screen without the pop-up actually launching. Occasionally, for a split second I will see:

unknown option: ' (Not sure what characters are actually in the space, I just see something similar to this)

This plugin is so good that I now feel lost without it! Any ideas what could be causing this?
I believe I'm running the latest version that only requires bash v3.

zoxide 0.9.2
fzf 0.44.1 (brew)
tmux 3.3a

Git worktree support

As a user, I want my session names to understand git worktrees and create helpful and appropriate session names, so I can better contextualize my sessions.

feature request: option to kill and detach from session

Would be nice to be able to add an option to kill and detach from a session.

I am currently using this

temp_session=$(printf '%s\n' "${$(for ip in "${$(tmux list-sessions -F "#{session_name}")[@]}"; do echo "${ip}"; done | sort -u)[@]}" | fzf-tmux --reverse -p 70% --border-label "Kill TMUX Session") 

test -n "$temp_session" && tmux detach -s $temp_session && tmux kill-session -t $temp_session

Error when running t outside a tmux session

Im getting this error:

/Users/user/.config/tmux/plugins/t-smart-tmux-session-manager/bin/T: line 116: conditional binary operator expected
/Users/user/.config/tmux/plugins/t-smart-tmux-session-manager/bin/T: line 116: syntax error near `$FZF_TMUX_OPTS'
/Users/user/.config/tmux/plugins/t-smart-tmux-session-manager/bin/T: line 116: `		if [[ ! -v $FZF_TMUX_OPTS ]]; then'

when I use the session manager from within an existing tmux session its workin fine.

Command to switch to last session

I really like your plugin, thanks for maintaining it! This issue is a feature request/idea. I often switch between two thux sessions. Then my workflow looks kind of like this

work in a session
prefix+T, arrow up, enter
work in other session
prefix+T, arrow up, enter
work in first session

It would be great if there was another command to switch to the last session. Then my workflow would become

work in a session
prefix+Tab
work in other session
prefix+Tab
work in first session

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.