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

Better handling of Zoxide Index for Session Creation #116

Closed
Msouza91 opened this issue Jun 6, 2024 · 4 comments · Fixed by #122
Closed

Better handling of Zoxide Index for Session Creation #116

Msouza91 opened this issue Jun 6, 2024 · 4 comments · Fixed by #122

Comments

@Msouza91
Copy link

Msouza91 commented Jun 6, 2024

Feature suggestion about how new sessions are handled here, might be just nitpicking on my part, but hear me out.

When I type in some part of a directory name that I know to be on my Zoxide history creating a session just with that part of the name might result into non descriptive names for the sessions and create some friction on having to rename said sessions, so in those cases a better approach would be using the full name of the directory instead for the session name, although a bit naive maybe but I think it should cover most cases.

Another option (inspired on Josh Medeski's plugin) would be instead of having this automatic session creation, have a binding similar to ^-x to open an fzf search on the zoxide index in which you could select the directory you want with precision and create a session with the directory name.

@omerxx
Copy link
Owner

omerxx commented Jun 7, 2024

Interesting!

  1. Are you suggesting sending the result to zoxide only after comparing it to the list of available options and then using the full name from the DB?
  2. Regarding your other option, while I can't really pop another window as I'm locked to fzf which in turn is locked to a tmux popup, I can use the preview panel to show zoxide results! This can be an interesting direction. Is that close to what you had in mind?

One note though - only displaying results from zoxide, even if possible, still doesn't give me the option to pick them. Perhaps I should load them into the dictionary feeding fzf on the fly. Not even sure that's possible I'm thinking out loud.

LMK what are you thoughts

@pinbraerts
Copy link

pinbraerts commented Jun 16, 2024

One note though - only displaying results from zoxide, even if possible, still doesn't give me the option to pick them.

It should be working. Take a look at my dotfiles. I was using it on a daily basis and now am migrating to tpm+sessionx

Also I noticed that zoxide sessions are created with a window with a specific name.

tmux new-session -ds "$target" -c "$z_target" -n "$z_target"

I think it would be better to take more atomic approach and have a single universal new-session with some default parameters and escaping like basename + replacing '.' character (switching to a session with '.' in name breaks tmux). It would make easier to allow user to control session creation

@pinbraerts
Copy link

Also I think the best approach here would be to allow any user command for input

guemidiborhane added a commit to guemidiborhane/tmux-sessionx that referenced this issue Jun 25, 2024
@omerxx
Copy link
Owner

omerxx commented Jun 25, 2024

Also I think the best approach here would be to allow any user command for input

I merged the PR adding the solution to this, however I do agree that some people may want to tweak the zoxide command. Feel free to reopen if you think it's necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants