I only end up finding features in tmux by fat fingering features I was attempting to use; it’s not very discoverable.
OT: What terminal color scheme are you using? It looks a like gruvbox dark but with a little more contrast.
It is indeed gruvbox dark, I don’t think I’ve done anything special with it, at least not intentionally.
It looks really sharp in your blog post. I need to start using it again.
I was unaware of display-menu, very cool. Thanks for sharing!
I’ll definitely stick with s to change sessions because the preview is so helpful, but I can think of a couple ways this can be helpful!
I agree, the preview is lovely. A use case for this menu based approach for me is for the sessions that I want to go to regardless of what’s in them (i.e. I don’t need to see). This is part of an experiment where I set up (sometimes at the start) the “long lived” sessions each with a different focus, and each with a differently colour-highlighted session name in the status bar (such as the “writing” session you can see in the first screenshot in the post).
One more trick if you haven’t seen this yet - there is a builtin interactive session-selector in tmux!
If your tmux prefix is alt-a, you can execute alt-a + s and you’ll get a list of all sessions, with previews of all panes/splits in that session.
alt-a + s
Hi there - thanks, yes - prefix s is something I use quite a lot and may continue to as well. As I mentioned in my post, the building of the menu-based session selector was more for learning about it rather than to replace anything. But I’m finding, at least for the “permanent” sessions that I have, where I know I want to switch regardless of what’s there, this simpler selector works quite well so far.
I myself use display-popup bound to C-s which executes a fzf-based switcher which allows to switch/create new sessions:
unbind -n C-s; bind -n C-s display-popup -x1 -y1 -w40% -h50% -E 'zsh -ic "s"'
I don’t know if it’s possible to add session preview to the fzf-based switcher based on fzf’s preview functionality (don’t know if tmux exposes “previews” somehow externall) though…
EDIT: ah, I see the author already explored a similar approach… but still, my fzf-switcher is a bit more elaborate (allows to create sessions on the fly / attach if outside of tmux or switch if inside of tmux) which allows me to use it as an entry point to tmux
This is great, thanks for sharing! Always happy to learn from others. And interested to see how different and how similar our solutions can be.
I’ve found that the more I look into tmux, the more I find. With the bonus that it’s all helpful in improving my workflow, too.