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

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.




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

Search: