27medkamal / tmux-session-wizard

One prefix to control all your session creation, naming, switching, etc using fzf & zoxide
MIT License
180 stars 14 forks source link

Support path not in zoxide from the fzf prompt #11

Closed claudio4 closed 8 months ago

claudio4 commented 8 months ago

Right now the only way to open a session to a path that wasn't already in zoxide was to give it as an argument to the script, something can not be done from tmux if invoked with the key bind.

With this PR, the script will try to use the fzf query as a path, if it is not a real path it will fail silently, otherwise it will use the path to create the new session as normal. Additionally, the path will be added to zoxide for future use. This has the side effect of promoting existing path in zoxide each time the script is given a path (either via fzf or directly), but this is rather desirable, as it makes sense that opening a session for the directory will count the same a navigating to it.

27medkamal commented 8 months ago

Looks great. Thanks for submitting this.