zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
20.91k stars 639 forks source link

Enhance Session Selection with Prefix Matching and Fuzzy Finder #3375

Open frolvanya opened 4 months ago

frolvanya commented 4 months ago

Instead of typing zellij a session-name, wouldn't it be better to use zellij a se (using just the first few characters)? If there are multiple names starting with the same prefix, we could then open fzf for selection:

$ zellij ls
session-1
session-2
main
$ zellij a se
> session-1
  session-2
# ideally empty matching string should result in fzf $(zellij ls)
# also, it should work only if we don't have any active sessions and we're looking to resurrect one
$ zellij a
> session-1
  session-2
  main
imsnif commented 4 months ago

You might be interested in the welcome-screen and/or the session-manager. They have this functionality (also with filtering your fuzzy found selection in real time in a list) built-in. You can check out this screencast for more info: https://zellij.dev/tutorials/session-management/

DerTimonius commented 1 month ago

If you already have fzf installed, you could create an alias to do something like what you suggest:

zellij attach $(zellij ls -s | fzf)

I use the following alias:

alias zat='zellij attach $(zellij ls -s | fzf)'