'When is multiple-window in one tmux session more appropriate than multiple tmux session?

I can't figure out when multiple-window in one tmux session is more appropriate than multiple tmux session. If I need multiple "window" in one tmux session I always use multiple-pane instead.

So I was wondering is there some "real" use case for multiple-window in one tmux session or it just provides as there is more than one way to do things?



Solution 1:[1]

I'm not sure if this would fit Superuser better or not. I will give this a shot:

  1. Space: Sometimes there's not enough screen real estate to fit the apps in the panes as you'd like

  2. Prioritization: This is purely subjective, for me the 1st window is where the critical work happens.

  3. Separation of concerns:

    • Frontend / backend
    • Development and build servers (e.g. celery) where the output isn't interesting
    • Temporary topics: e.g. customizing ~/.dotfiles to customize thing

Personally I keep these in my first window:

  1. Editor (main pane)
  2. Shell (for commands)
  3. Builder (webpack, rollup, etc)
  4. HTTP Server (for logs and restarting it as needed)

In the 2nd window, optional stuff: tunnels, celery / rq / whatever job server / log tailing. They don't crash as often and their logs aren't as interesting.

The above would be too much to fit in a single window. Or it would be super noisy.

I use 2 windows to separate development from documentation in my software projects. As an example, vcspull: session file (Disclosure: I am creator of tmuxp, which launches tmux sessions in .tmuxp.yaml files).

Further, I join interdependent projects to the same tmux session in separate windows. e.g. using pip install -e ../otherproject, npm link, or yarn link. e.g. when developing a django project, I may keep a package I'm writing a fix for in the other window so I can restart the server and see the changes relatively fast.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1