Replies: 5 comments 4 replies
-
oh ok, i get what fzf and zoxide are independently for. so zoxide is used like a shell working dir history manager here, also doubles as replacement for cd with some pixie dust sprinkled on top, got to use it at least a little to populate that history. fzf used as frontend, what's going on is feeding zoxide' list into fzf to give it an effectively auto-curated list of dirs to hang tmux sessions off of. to try to summarize my questioning a bit... i think all i'm thinking this system needs to fully round it out is a minimum surprise interface to rapidly navigate between sessions. I think anchoring sessions to directories is kind of genius, even if it is entirely possible to cd away from the dir you've named your session after. One thing i wonder is maybe if zoxide is used the right way then the order of its output (and initial fzf state) could be this very MRU listing and that could be used directly, that would be pretty elegant. But I think not since the preferred semantic is most-recently-open tmux session, that would not be something zoxide has any awareness of... |
Beta Was this translation helpful? Give feedback.
-
There's a lot of questions and thoughts here @unphased! I'll do my best to cover some of what you've brought up.
Okay wow, those are some of my thoughts. I'll be making a "why use sesh?" kind of video soon and go more in depth with the mental model and how to best leverage the tool to be more productive. Thanks for showing interest and I hope these thoughts help! |
Beta Was this translation helpful? Give feedback.
-
I only switch between windows to glance at dev server logs or switch to lazygit. Otherwise I'm switching between sessions to look at files in a different project. I vary rarely type |
Beta Was this translation helpful? Give feedback.
-
@joshmedeski is there a way to get the current session information as an argument in the startup script? For example, I want to change the title of my terminal window to display the session name so that I can quickly search for specific terminal window in window switcher applications like rofi/dmenu when I have multiple terminal windows open. |
Beta Was this translation helpful? Give feedback.
-
@enthusiva sure! You can use the #!/usr/bin/env bash
CURRENT_SESSION=$(tmux display-message -p "#S")
tmux new-window -n "$CURRENT_SESSION:nvim" nvim Hope it helps! |
Beta Was this translation helpful? Give feedback.
-
Hi Josh, I watched your video on T which helped me immensely to understand your workflow. I'm a longtime tmux user and alacritty has also been my macOS terminal of choice. I am also an fzf enthusiast. I came upon this repo from a link from reddit, but it simply would not click for me, because the way I use tmux has been to very very seldom use sessions. So the notion of this deep streamlining around session navigation is very foreign to me but still very intriguing as it's likely to open up more flexibility if added to my workflows.
As part of transitioning from a vimL init script to a lua one as well as switching from vim to nvim, I found with the new plugins I am using (Heirline, Trouble, Nvim-tree) it has a very streamlined flow for switching buffers. As such I found I no longer regularly use vim tabs and mainly switch buffers now. What I found was that although tabs and splits are powerful, in practice work involves focusing on one file at a time, and what would repeatedly happen is the layouts I'd be building would keep getting messed up from the rapid navigation I'd do and it turns out more streamlined to mostly do away with having that layout state to begin with.
It is clear that switching from using tmux windows and split panes to making use of sessions represents a similar transition at the tmux level, because I am having a similar inefficiency by continuing with my existing split-heavy tmux window usage.
Since I often attempt to use terminals from really constrained interfaces like my phone, having a mostly full screen workflow like yours looks to benefit me greatly in that scenario when it comes to navigation. It also stands to streamline and improve focus in my usual environment with a bigger screen, so I'm excited to try this out.
I still want to pick your brain though.
You don't use tmux with any "chrome" aka status lines. You just have a minimal title line at the top with the session name it seems. I can't tell if this is a statusline put at the top somehow, or a pane status line, in which case when you split panes in your session, all panes would then have a statusline indicating the same session name (that may be "inefficient").
Why do you prefer it this way? Just minimalism? My 5+ year old approach to cramming all the information I figured might be useful (and some of it often is, like PID of child of the process! actual PID is usually just for the shell) is pretty great, but when my terminal is sufficiently small (like on a phone especially) it often crowds out the information I want, like the window bar, etc. Clearly it's time for me to make a change, and I need to take a page out of your book here and go minimalist too. If I were to do this though I would still use a status bar showing the current session name, but I would at minimum add a counter to show how many sessions total exist as a hint to go clean up once there are too many. But I would clean up the bulk of the crap I have in my status bar such as pane_title, pane_current_command, pane_current_path, etc.
Def looks like you use sessions like I use my tmux windows. It actually seems like there is not much practical difference between these. I can think of at least one thing, with windows you can move panes around the windows. Not sure if it's possible to move a pane across sessions. I mean.. I never saw you open more tmux windows or do a single tmux split. Do you ever use these features? I think I will move more toward what you do and organize "workspaces" (regardless of whether they're primarily sessions or windows) by working dir, as that's what I found myself converging on organization by... but sometimes a workflow requires operations between two locations and side by side panes is the best way for that. Surely you have those too, in such a situation (say you have a session with a split in it open to terms in different dirs), when you are done with that, do you ... Nuke the session? Clean it up manually immediately? Leave it and clean it up later when you want to work in that dir again? Something else? Based on what I saw nuking it right away seems likely the way to go, since you have implemented super streamlined opening of a clean session on a dir name not-already-having-an-open-session.
Although I enjoy fzf greatly and it is maximally efficient to go to a destination by inputting a portion of a name, When I work on stuff even 1s taken to type 5 chars to toggle back and forth is still much slower than simply switching via some next/prev navigation. For example the way I do things now is I'll usually have a tmux window for vim config and one for my current project I'm hacking on, and another for a different project. So, 3 windows. To switch between hacking on these 3 different things all I gotta do is cycle forward or back in the list of windows and I can see what they are and their order in the statusline. Similarly I'll always have at least 4 panes open in each window (in retrospect this is too much and i want to reduce it) and I have binds (directional ctrl+hjkl as well as other keys to cycle forward/back) to spatially switch across the panes.
From your video, the sense that I get is you have probably 5 or 6 sessions you'll regularly switch between and you're pretty committed to typing out the name each time to go there, with help from both zoxide and fzf. Now I'm not totally understanding how these two are combined together yet since they still feel like mutually exclusive tools to go from terse input to picking a real absolute directory path, but I'm sure I'll understand that soon enough. I did see you open up the tmux built in session switcher interface, which IMO is a fine and dandy interface. I think that this presents a linear ordering of your open sessions and we could hypothetically make a little statusline or some indicator for that state and have binds to cycle forward and back through sessions themselves. I feel like I would NEED this if I switch to maining session instead of windows. What do you think? Wouldn't you at least want a quick "go to prev open session" keybind? Some stuff at least to get to parity with for example OS native Cmd+Tab and Cmd+` for quickly switching to previous apps/windows?
Beta Was this translation helpful? Give feedback.
All reactions