Also of note to the devs, there may be a bug with regards to the
creation and detaching of a session within the same commandline.  It
works, but yields the following output.

$ tmux new -s xxx \; detach
fatal: main_dispatch: unexpected message

Mike


On Wed, Jan 12, 2011 at 4:56 PM, mbm329 <mbm...@gmail.com> wrote:
> Oops, since you're already attaching because you pretty much _have_
> to, the "attach" can be removed from the line I gave:
>
> tmux new-session -s xxx 'perl test.pl' \; splitw -v \; split-window -v
> \; resize-pane -U -t0 500 \; resize-pane -U -t1 500 \; resize-pane -D
> -t0 8 \; resize-pane -D -t1 8 \; detach
>
> Mike
>
>
> On Wed, Jan 12, 2011 at 4:51 PM, mbm329 <mbm...@gmail.com> wrote:
>> Hi depesz,
>>
>> I too am evaluating tmux to see if it would be a suitable replacement
>> of gnu screen.  Your questions are interesting to me as well.  As I've
>> only been playing around with tmux for a few days, I decided to
>> attempt a solution for you.  I am in no way an expert on this and
>> expect I will be corrected shortly if I am wrong ;)
>>
>> It appears as though tmux gets it's own geometry for the panes from
>> _your_ terminal session; and it's all relative to the terminal
>> window's size.  You can see this by taking a small terminal window and
>> sizing the panes exactly like you want, and then expand the terminal
>> to full-screen.  You will see the number of lines/characters in each
>> pane is different now.  They won't stick to the explicit 10 lines per
>> pane you are hoping for.
>>
>> Here's a line that will work for you, I think.  But it will require
>> you connect to a terminal to size them. I've tried setting resize-pane
>> without an attach and it wouldn't work.
>>
>>  Basically, what this does is split the windows like you want, and
>> then resize the first two panes upward to the smallest size (2 lines)
>> by using an extreme size of 500 lines.  Following that, it will resize
>> downward by 8 lines to give you a pane size of 10 lines.
>>
>> tmux new-session -s xxx 'perl test.pl' \; splitw -v \; split-window -v
>> \; attach \; resize-pane -U -t0 500 \; resize-pane -U -t1 500 \;
>> resize-pane -D -t0 8 \; resize-pane -D -t1 8 \; detach
>>
>> I know you were looking for a way to size them without connecting to a
>> terminal, but I'm not sure you can get around that.  Patrick's
>> solution with xterm is probably the closest you could get, and that
>> would require at least an X-Server.
>>
>> xterm -geometry 178x53 -ls -e "tmux new-session -s xxx 'perl test.pl'
>> \; split-window -v \; split-window -v \; attach \; resize-pane -U -t0
>> 500 \; resize-pane -U -t1 500 \; resize-pane -D -t0 8 \; resize-pane
>> -D -t1 8 \; detach"
>>
>> You can get your xterm geometry by starting a new session and running
>> "tmux ls" and it will show you your window size.  Just +1 to the
>> height.
>>
>> Good luck,
>>
>> Mike
>>
>>
>> On Wed, Jan 12, 2011 at 1:02 PM, hubert depesz lubaczewski
>> <dep...@depesz.com> wrote:
>>> On Wed, Jan 12, 2011 at 12:58:27PM -0500, Patrick Shanahan wrote:
>>>> * hubert depesz lubaczewski <dep...@depesz.com> [01-12-11 11:53]:
>>>> >
>>>> > that is - I use 3 panels, split horizontally, with the top 2 having 
>>>> > predefined, fixed height of 10 lines.
>>>> >
>>>> > Now - I know I can make it myself, but running tmux, doing the split, 
>>>> > and then
>>>> > manually changing sizes of panes, but I'm looking for a script-based way 
>>>> > to do
>>>> > it.
>>>> >
>>>> > In general - I need a script that will:
>>>> > 1. check for existing session
>>>> > 2. if the session exists - exit
>>>> > 3. if it doesn't exist - make new one, detached
>>>> > 4. in the new session, on first window, make 3 panes, change their sizes 
>>>> > to 10 lines, 10 lines, rest
>>>> >
>>>> > i checked the docs and examples, and even bugged people on irc, but I 
>>>> > wasn't able to get to a way to do it.
>>>>
>>>> get an xterm window with size 136x52 at 575+20
>>>>    black on white
>>>>    title "Pakas Tmux ML"
>>>>    attaches existing session or starts new if no existing
>>>>
>>>> xterm -geometry 136x52+575+20 -ls -bg white -fg black \
>>>>       -title "Pakas Tmux ML" -e tmux -2u attach
>>>>
>>>>
>>>>
>>>> ~/.tmux.conf
>>>>   split-window -v -l 10
>>>>   swap-pane -U
>>>>   split-window -v -l 10
>>>>
>>>>
>>>> will give you three panes but the two lowers will be 10 lines each
>>>
>>> I know about split -l, but as you said - it will work for lower panes
>>> only. any way to do it with top panes?
>>>
>>> as for the xterm command - most of the steps I can do on my own, i have
>>> problems only with the 10 lines requirement, and too small default
>>> *detached* window.
>>>
>>> Best regards,
>>>
>>> depesz
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Protect Your Site and Customers from Malware Attacks
>>> Learn about various malware tactics and how to avoid them. Understand
>>> malware threats, the impact they can have on your business, and how you
>>> can protect your company and customers by using code signing.
>>> http://p.sf.net/sfu/oracle-sfdevnl
>>> _______________________________________________
>>> tmux-users mailing list
>>> tmux-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/tmux-users
>>>
>>
>

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to