You are not logged in.

#1 2016-01-30 04:12:19

publicus
Member
Registered: 2014-01-01
Posts: 129

Configuring tmux to run specific apps and making terminals

Hello,

I'm sure some have heard of the terminal multiplexer called "screen".  It's a joy when you can have many terminals as opposed to just one over something like SSH.  The problem with screen is that it's old and not very well maintained (and when you become proficient with it, you begin noticing annoying productivity issues.)  Enter "tmux".  Tmux is much better maintained, allows you to skip around terminals much more easily.  It's a winner!

My problem with it?  When I start up screen, I can configure it to open up 9 terminals immediately and in the first two terminals, I have it display htop and nload by default.  I can set this up in my ~/.screenrc file.  For tmux, I have .tmux.conf (shown below) and it does not start up multiple windows whenever I start tmux.  What I don't understand is, why?  Shouldn't the file get loaded and I will get my terminals showing below?  If not, then what the heck am I doing wrong?

# set default scroll back to 10000 lines of history.
set -g history-limit 100000

# set default windows.
new  -n htop htop
neww -n nload nload
neww -n bash bash
neww -n bash bash
neww -n bash bash
neww -n bash bash
neww -n bash bash

Offline

#2 2016-01-30 04:18:59

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Configuring tmux to run specific apps and making terminals

Works as is for me...

Did you restart the server after changing your config?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-01-30 04:31:38

publicus
Member
Registered: 2014-01-01
Posts: 129

Re: Configuring tmux to run specific apps and making terminals

jasonwryan wrote:

Works as is for me...

Did you restart the server after changing your config?

Ok, you're right, I didn't do that.

One odd thing that is happening is that tmux does start up, but I still see just one terminal open.  When I close that one and do tmux list-sessions, I see a different session.  When I attach to that, I see the multiple tabs that are started that I wanted.  Why don't I see them right away?

Offline

#4 2016-01-30 05:57:34

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Configuring tmux to run specific apps and making terminals

What happens if you start the server with `tmux attach`?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2016-01-30 11:50:37

publicus
Member
Registered: 2014-01-01
Posts: 129

Re: Configuring tmux to run specific apps and making terminals

jasonwryan wrote:

What happens if you start the server with `tmux attach`?

I get my 7 terminals like I have specified in .tmux.conf...

It's as if doing it just `tmux` starts up the server with a session and doesn't bother attaching to it...

Offline

#6 2016-01-30 18:50:05

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 341
Website

Re: Configuring tmux to run specific apps and making terminals

@Publicus   I found a script on the wiki and bastardised it somewhat, i *think*  this https://youtu.be/cBuKLTHw9Gg is what your looking for, ofc it will need some modifiactions, the link to the script is in description.

Offline

#7 2016-01-30 19:07:17

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Configuring tmux to run specific apps and making terminals

publicus wrote:
jasonwryan wrote:

What happens if you start the server with `tmux attach`?

I get my 7 terminals like I have specified in .tmux.conf...

It's as if doing it just `tmux` starts up the server with a session and doesn't bother attaching to it...

This is the intended behaviour as described in the man page.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2016-02-01 03:35:49

publicus
Member
Registered: 2014-01-01
Posts: 129

Re: Configuring tmux to run specific apps and making terminals

cirrus wrote:

@Publicus   I found a script on the wiki and bastardised it somewhat, i *think*  this https://youtu.be/cBuKLTHw9Gg is what your looking for, ofc it will need some modifiactions, the link to the script is in description.

That is filthy!

Thanks dude.  I'll definitely have a look.

Offline

#9 2016-02-01 03:38:18

publicus
Member
Registered: 2014-01-01
Posts: 129

Re: Configuring tmux to run specific apps and making terminals

jasonwryan wrote:
publicus wrote:
jasonwryan wrote:

What happens if you start the server with `tmux attach`?

I get my 7 terminals like I have specified in .tmux.conf...

It's as if doing it just `tmux` starts up the server with a session and doesn't bother attaching to it...

This is the intended behaviour as described in the man page.

I think I'll have to do more research and experimentation with this.  It's obvious that I still don't know that much about tmux...

Offline

Board footer

Powered by FluxBB