Can someone explain what happens to tmux , bash and exec ? I am trying to setup a tmux session with a 4 window window. Ideally, I want to run a command in 3 of the panels: for example. Ruby Thin server and several Ruby daemons. This is what I still have:
~/.bin/tmux-foo :
#!/bin/sh tmux new-session -d -s foo 'exec pfoo "bundle exec thin start"' tmux rename-window 'Foo' tmux select-window -t foo:0 tmux split-window -h 'exec pfoo "bundle exec compass watch"' tmux split-window -v -t 0 'exec pfoo "rake ts:start"' tmux split-window -v -t 1 'exec pfoo' tmux -2 attach-session -t foo
~/.bin/pfoo :
#!/bin/bash cd ~/projects/foo rvm use ree
Everything works ... but when I ctlr-c in the first panel on which the thin server is running, it stops the thin server and returns to the shell. However, the team is not in history; that is, if I press the up key, I do not get the bundle exec thin start command ... I get another command from my bash story. I am wondering if there is a way to organize these scripts in order to get commands in the bash history.
Also ... I tried many combinations of exec , exec $SHELL -s ... and exec $SHELL -s ... -I , and I'm not quite sure what is happening ...
Can someone explain the general idea of ββwhat happens with tmux and bash and exec here?
bash exec tmux
Aaron Gibralter Mar 27 2018-11-11T00: 00Z
source share