4 ms·
I've gotten comfortable with the way tmux works, but the complaints raise a valid point. Its default behavior of prioritizing server environment over session en
by mekoka 4y ago
I've gotten comfortable with the way tmux works, but the complaints raise a valid point. Its default behavior of prioritizing server environment over session environment is probably the wrong one. Maybe those who don't see this are conflating windows and sessions (I can clearly see this in the comments). Different sessions imply radically different projects, paradigms, contexts. Whereas different windows in a session imply different perspectives, views, within a shared paradigm.
Intuitively, it makes sense to be able to start a tmux session after setting up some global (i.e. session wide) environment variables, so that all new windows spawned in that session inherit them. Once you've specified the database or various urls, you don't want to have to source some environment file each time you spawn a window. The session should just already know all this.
Inheriting some super global variables (i.e. server wide, machine wide) by default (as opposed to explicitly setting a flag) implies that a shared environment across sessions is more useful than a shared environment across windows within the same session. It's a matter of opinion, taste, or maybe of UX data points, but I suspect that the latter would be favored if there ever was a survey.
- ghshephard 4y agoIn 10+ years, outside of perhaps experimenting with the feature for a few hours to see how it works - I've never created a second session in tmux. I routinely will have 20-25 windows and another 4-6 subpanes inside those windows though. I'm wondering if sessions were more relevant before we all had 30+" monitors on our desk, and panes were less useful. Or perhaps some people have, as you noted, more well defined work/project paradigms that they can associate with a session. With that said - in my day job, we have a really well engineered set of tooling that lets us manage our certificates, ssh keys, and orchestraor/security engine/service discovery tokens - but I'm managing and updating dozens of environments/configs - honestly the environment that I opened even a single pane (inside a window) might shift several times over 5-10 minutes into entirely different clusters - what that pane started with is mostly irrelevant - (and clearly the windows/session and "Tmux Server" environment that I started with is so irrelevant as to be meaningless). About the only global original configurations that I care about and want to carry into my work are bound to my client (/etc/hosts, /etc/resolv.conf, interface, VPN, etc...) The one thing that I've gotten out of this thread is that I probably should be more empathic to other people's workflow - not everyone has the same datacenter/cluster/server environments that I do - and instead of having tooling to manage their environment, they might just rely on what it was when they were launching a "new tmux session at that point in time" (a concept I had never considered until today).