Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The main thing that I wish I could have in tmux is the ability to disable other sessions attached to the current terminal without outright detaching them. I intend to go back to that other machine at some point, I just don't want its tiny screen making my current session tiny for no reason.

Maybe this is actually possible already and I just haven't found it?



Say you want to attach to session 0 (use `tmux list-sessions` to see available sessions).

A trick I've found is not attaching to that session, but starting a new session sharing all underlying windows. The model in tmux is [session]->[windows]->[panes], but something I did not realize until recently is that [session] can be multiple.

So rather than `tmux attach -t 0` use `tmux new-session -t 0`, allowing you to interact with the same windows without disturbing the other session.


Is this a feature in 2.0? It doesn't seem to work for me - I still see a large part of my terminal window filled with the dots, since the other session's terminal window is much smaller.


Ah, I forgot to mention: the resize -if the terminal-window is smaller- will still happen, but as long as the two sessions are operating on a different window they can be of different size.


I think I'm missing something.

Terminal A: 300x10 lines (long across, but short) Terminal B: 120x30 lines (standard new terminal size)

I have a tmux session running in A; I open terminal B, and attach to it with -new-session. My first pane is trimmed to the height of Terminal A.

If I do prefix-c (create new pane), the new pane is now the size of Terminal B - hurray!

But if I open Terminal C, which is yet another size, and attach to my existing session, it resizes every pane in Terminal B to the size of Terminal C; and when I disconnect from Terminal C, those panes do not appear to switch back to what they now should be, unconstrained by Terminal C.

(If I didn't explain this clearly, I can provide some screenshots later.)


> But if I open Terminal C, which is yet another size, and attach to my existing session [...]

I might be misunderstanding, but could you not use `tmux new-session -t 0` again for the third terminal?

> and when I disconnect from Terminal C, those panes do not appear to switch back to what they now should be, unconstrained by Terminal C.

Odd. Unrelated to your earlier issue, but that's not what I'd expect or am seeing when I try to reproduce is locally.


you need to turn on aggressive resizing.


Aha, thanks!

(Also, good to see you again, digitally - how's your hemisphere?)


Pretty good; working from a co-working space here. Just bought an apartment.


I don't have any issue with the session itself being shared. It's actually the desired behaviour almost all the time. I just don't want to be dependent on the frame sizing of a terminal no one's even looking at.


jbnicolai's method kinda solves this for me. The upshot is the set of windows is mirrored between both clients, but they can each be looking at different windows. You still have a problem if the other client is looking at the same window that you're on, though.


Would doing <bind>D (note the casing) help? It will list all the currently attached sessions and allow you to remotely disconnect them. I use it when I forget to detach at home and I'm at work or vice versa.


That's exactly what I do. First of all, it's annoying that I have to go and choose each one to detach it. Second, I usually invoke tmux directly with mosh or ssh -t, so detaching also disconnects them, which I don't really want.

I basically want an untouched session to go into a screensaver mode where it no longer controls the terminal size.

It's certainly not the end of the world to detach them, but I'd rather not. And detaching before I leave a session is just busywork.


Just send it to a different session then switch back when you're ready.


Could you explain in more detail? I don't understand the practical meaning of what you're suggesting.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: