Re: tmux layout heuristics (cf. xmonad)
Sending everything over a pipe from client to server and vice versa is slow, it would have to use shared memory. Although in reality there is no reason the client has to be involved for any implementation, the server has a copy of the tty fd so it can do whatever it likes. You could use another session a store for inactive windows. If code was added to specify "highest window index" as a target (trivial), using a session as a stack could be done quite easily. There is no reason hidden panes couldn't be supported natively to allow a "one pane" layout but at the moment it violates assumptions in the layout code which would have to be changed. On Fri, Feb 26, 2010 at 12:03:56PM -0700, Aaron Denney wrote: > On Fri, Feb 26, 2010 at 10:34:33PM +1100, Trent W. Buck wrote: > > Now, I come to tmux, which has windows *and* panes. It looked like I > > can get something very like xmonad by simply using only one window, and > > always creating frames, e.g. using ^B" instead of ^Bc. I can then use > > :next-layout to switch layout heuristic. > > > > But: confusion! There is no "just one app" layout in tmux! My first > > guess is that there must be some way to move apps out of the current > > window (without killing them), such that "just one app" is simply to > > move all but the current app into a second "unmapped apps" window. But > > I can't find such a command. > > > > Have I simply misunderstood the "right" way to use panes and windows in > > tmux? > > Right. The panes are not merely something that the client uses to keep > track of what set of ttys should be associated with a window. They > are instead a reification of the actual layout, kept in the server. > The layout managers do not just choose what to display, but change the > parameters, and let the layout happen. This means that to not display a > tty, you need to remove the corresponding pane from the window, either > closing it, or moving it elsewhere. There is no per-window "inactive > list" they can be kept on. > > I do not like the current behaviour very much. What you are hoping for > is also not my preferred model, but would be interesting, though requiring > substantial coding. > > I have advocated before that panes be an entirely client-side structure, > rather than the current server-side, and that the server just keep track > of n ttys, and let clients display, and position them as they wish. > This too would involve substantial code modifications, but make it a bit > easier to code up and explore new UI modes. > > Code, of course, speaks louder than words, and I won't have any time soon > to work on such a refactoring. > > -- > Aaron Denney > -><- > > -- > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > ___ > tmux-users mailing list > tmux-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tmux-users -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux layout heuristics (cf. xmonad)
tmux does not tile panes automatically, it is up to you to tile them. You can always bind a key to "splitw; selectl some-layout" if you want it to happen every time you split. On Fri, Feb 26, 2010 at 10:34:33PM +1100, Trent W. Buck wrote: > Being accustomed to xmonad's layout model, I find the tmux one a little > confusing. In xmonad (at least as _I_ use it), one has a set of apps[0] > open, and these are automatically tiled according to some layout > heuristic[1], such as "divide apps equally, side-by-side". > > However, in xmonad, an app might be running but not currently visible > onscreen. This is most noticable in the default layout heuristic, which > is "show only one app, filling the display". > > Now, I come to tmux, which has windows *and* panes. It looked like I > can get something very like xmonad by simply using only one window, and > always creating frames, e.g. using ^B" instead of ^Bc. I can then use > :next-layout to switch layout heuristic. > > But: confusion! There is no "just one app" layout in tmux! My first > guess is that there must be some way to move apps out of the current > window (without killing them), such that "just one app" is simply to > move all but the current app into a second "unmapped apps" window. But > I can't find such a command. > > Have I simply misunderstood the "right" way to use panes and windows in > tmux? > > Going from ratpoison to xmonad, or screen to tmux, and having the WM > automatically manage the :split/:only/:remove/:resize operations via > user-defined layout heuristics is the "killer feature" for me, so I'd > quite like to grok how tmux wants me to do it :-) > > [0] I use "app" to mean an X client window (e.g. xlogo) or a tty client > (e.g. top), so as not to conflate X11 windows with tmux windows. > > [1] I believe most (all?) tiling window managers of the dwm era support > layout heuristics, but I'm only familiar with xmonad. > > > -- > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > ___ > tmux-users mailing list > tmux-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tmux-users -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users
Re: tmux as login shell without chsh
You probably want to "exec tmux new-session", or use "tmux new-session -d" instead. Otherwise if it works it must be fine, shell script isn't meant to be elegant... :-) On Fri, Feb 26, 2010 at 09:57:39PM +1100, Trent W. Buck wrote: > Because screen doesn't implement -c like a normal shell, I can't use it > as my login shell without breaking scp(1) and suchlike. Thus for some > time I've had this in my .bash_profile: > > ## The naive "chsh -s /usr/bin/screen" breaks scp (and other things). > ## Have sh start screen automatically "when appropriate". That is, > ## 1) not in a screen window (STY); > ## 2) stdin is a tty; > ## 3) screen is installed; and > ## 4) terminal is capable of displaying screen. > ## Replace "$STY" with "$STY$SSH_CLIENT$SSH_ORIGINAL_COMMAND" to avoid > ## nesting screens when sshing (untested). > test -z "$STY" -a -t 0 && > { which screen && tput clear && tput cup && ! tput hc && ! tput os > } &>/dev/null && # ignore boring, expected error messages > { > ## If new session, start agents. > screen -ls | grep -qi 'No Sockets found' && > eval "$(twb-agents)" > ## Start screen. > exec screen -DRR > } > > The other advantage of this hack is that my login shell, stored in NIS, > remains valid on hosts where neither screen nor tmux are installed. It > is for this reason that I wish to extend the code above to auto-start > tmux, rather than simply making tmux my login shell. > > The implementation below seems to work, but I suspect it's neither > correct nor ideal. I'd appreciate any critique you care to give. Bash > and a GNU userland can be assumed, but I can't assume RECENT ones (some > hosts are still Fedora Core 1). > > test -z "$STY$TMUX" -a -t 0 && > { > which tmux &>/dev/null && > { > tmux list-sessions &>/dev/null || > { > eval "$(twb-agents)" > tmux new-session > } > exec tmux attach-session -d > } > > { which screen && tput clear && tput cup && ! tput hc && ! tput os > } &>/dev/null && # ignore boring, expected error messages > { > ## If new session, start agents. > screen -ls | grep -qi 'No Sockets found' && > eval "$(twb-agents)" > ## Start screen. > exec screen -DRR > } > } > > > PS: twb-agents is basically a NIH rewrite of Gentoo's keychain(1), see > http://twb.ath.cx/Preferences/.bin/twb-agents . > > > -- > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > ___ > tmux-users mailing list > tmux-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tmux-users -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users