summaryrefslogtreecommitdiffstats
path: root/key-bindings.c
AgeCommit message (Collapse)Author
2013-03-24Add resize-pane -Z to temporary zoom the active pane to occupy the fullNicholas Marriott
window or unzoom (restored to the normal layout) if it already zoomed, bound to C-b z by default. The pane is unzoomed on pretty much any excuse whatsoever. We considered making this a new layout but the requirements are quite different from layouts so decided it is better as a special case. Each current layout cell is saved, a temporary one-cell layout generated and all except the active pane set to NULL. Prompted by suggestions and scripts from several. Thanks to Aaron Jensen and Thiago Padilha for testing an earlier version.
2013-03-24Add a command queue to standardize and simplify commands that call otherNicholas Marriott
commands and allow a command to block execution of subsequent commands. This allows run-shell and if-shell to be synchronous which has been much requested. Each client has a default command queue and commands are consumed one at a time from it. A command may suspend execution from the queue by returning CMD_RETURN_WAIT and then resume it by calling cmd_continue() - for example run-shell does this from the callback that is fired after the job is freed. When the command queue becomes empty, command clients are automatically exited (unless attaching). A callback is also fired - this is used for nested commands in, for example, if-shell which can block execution of the client's cmdq until a new cmdq becomes empty. Also merge all the old error/info/print functions together and lose the old curclient/cmdclient distinction - a cmdq is bound to one client (or none if in the configuration file), this is a command client if c->session is NULL otherwise an attached client.
2013-03-22Need to set clients in context before changing their reference count.Nicholas Marriott
2013-03-22Remove unnecessary initializers of cmd_ctx.Nicholas Marriott
2013-01-17Remove the layout undo/redo code which never really worked.Nicholas Marriott
2012-07-10xfree is not particularly helpful, remove it. From Thomas Adam.Nicholas Marriott
2012-07-08Add choose-tree command to show windows and sessions in the sameNicholas Marriott
list. Change choose-window and -session to use the same code. From Thomas Adam.
2012-06-18Add a couple of NULL pointer checks to key binding functions, fromNicholas Marriott
jspenguin on SF bug 3535531.
2012-04-01Add a layout history which can be stepped through with select-layout -uNicholas Marriott
and -U commands (bound to 'u' and 'U' by default).
2012-01-21Use RB trees not SPLAY.Nicholas Marriott
2011-07-03Include the existing window and session name in the prompt when renamingNicholas Marriott
and add a new key binding ($) for rename session. From Tiago Cunha.
2011-01-04Clean up and simplify tmux command argument parsing.Nicholas Marriott
Originally, tmux commands were parsed in the client process into a struct with the command data which was then serialised and sent to the server to be executed. The parsing was later moved into the server (an argv was sent from the client), but the parse step and intermediate struct was kept. This change removes that struct and the separate parse step. Argument parsing and printing is now common to all commands (in arguments.c) with each command left with just an optional check function (to validate the arguments at parse time), the exec function and a function to set up any key bindings (renamed from the old init function). This is overall more simple and consistent. There should be no changes to any commands behaviour or syntax although as this touches every command please watch for any unexpected changes.
2010-12-11Track the last session for a client and add a flag to switch-client andNicholas Marriott
a key binding (L) to move a client back to its last session.
2010-10-23Add a last-pane command (bound to ; by default). Requested ages ago byNicholas Marriott
somebody whose name I have forgotten.
2010-09-08Add -n and -p flags to switch-client to move to the next and previousNicholas Marriott
session (yes, it doesn't match window/pane, but so what, nor does switch-client). Based on a diff long ago from "edsouza".
2010-06-26Setting the cmdlist pointer in the bind-key to NULL to prevent it being freedNicholas Marriott
after the command is executing is bogus because it may still be needed if the same command is going to be executed again (for example if you "bind-key a bind-key b ..."). Making a copy is hard, so instead add a reference count to the cmd_list. While here, also print bind-key -n and the rest of the flags properly. Fixes problem reported by mcbride@.
2010-06-21Add a choose-buffer command for easier use of the paste buffer stack.Nicholas Marriott
2010-05-05Identical behaviour to select-prompt can now be obtained withNicholas Marriott
command-prompt, so remove select-prompt and change ' to be bound to command-prompt -p index "select-window -t :%%".
2010-04-25Add a tiled layout, originally from Liam Bedford a while ago, fixed upNicholas Marriott
by me.
2010-04-06Merge copy mode and output mode, dropping the latter. Idea and code fromNicholas Marriott
Micah Cowan.
2010-03-22Support up, down, left, right movement through panes with -UDLR flags toNicholas Marriott
select-pane. Also REMOVE the up- and down-pane commands: equivalent behaviour is now available using -t :.+ and -t :.-.
2010-02-06Support attaching a client read-only with a new -r flag to the attach-sessionNicholas Marriott
command.
2009-12-10Add "server options" which are server-wide and not bound to a session orNicholas Marriott
window. Set and displayed with "set -s" and "show -s". Currently the only option is "quiet" (like command-line -q, allowing it to be set from .tmux.conf), but others will come along.
2009-12-03Massive spaces->tabs and trailing whitespace cleanup, hopefully for the lastNicholas Marriott
time now I've configured emacs to make them displayed in really annoying colours...
2009-11-18Add a per-client log of status line messages displayed while that clientNicholas Marriott
exists. A new message-limit session option sets the maximum number of entries and a command, show-messages, shows the log (bound to ~ by default). This (and prompt history) might be better as a single global log but until there are global options it is easier for them to be per client.
2009-11-13Zap unused functions, prompted by deraadt.Nicholas Marriott
2009-10-06Remove scroll mode which is now redundant, copy mode should be used instead.Nicholas Marriott
The = key binding now does nothing.
2009-08-31Add a new display-panes command, with two options (display-panes-colour andNicholas Marriott
display-panes-time), which displays a visual indication of the number of each pane.
2009-08-25Add a choose-client command and extend choose-{session,window} to accept aNicholas Marriott
template. After a choice is made, %% (or %1) in the template is replaced by the name of the session, window or client suitable for -t and the result executed as a command. So, for example, "choose-window "killw -t '%%'"" will kill the selected window. The defaults if no template is given are (as now) select-window for choose-window, switch-client for choose-session, and detach-client for choose-client (now bound to D).
2009-08-23The cursession member in struct cmd_ctx is always either curclient->session orNicholas Marriott
NULL when curclient is also NULL, so just eliminate it.
2009-07-24Permit commands to be bound to key presses without the prefix key first. TheNicholas Marriott
new -n flag to bind-key and unbind-key sets or removes these bindings, and list-key shows them in []s.
2009-07-21Tidy up keys: use an enum for the key codes, and remove the macros which justNicholas Marriott
wrap flag sets/clears/tests.
2009-07-19Improved layout code.Nicholas Marriott
Each window now has a tree of layout cells associated with it. In this tree, each node is either a horizontal or vertical cell containing a list of other cells running from left-to-right or top-to-bottom, or a leaf cell which is associated with a pane. The major functional changes are: - panes may now be split arbitrarily both horizontally (splitw -h, C-b %) and vertically (splitw -v, C-b "); - panes may be resized both horizontally and vertically (resizep -L/-R/-U/-D, bound to C-b left/right/up/down and C-b M-left/right/up/down); - layouts are now applied and then may be modified by resizing or splitting panes, rather than being fixed and reapplied when the window is resized or panes are added; - manual-vertical layout is no longer necessary, and active-only layout is gone (but may return in future); - the main-pane layouts now reduce the size of the main pane to fit all panes if possible. Thanks to all who tested.
2009-07-17- New command display-message (alias display) to display a message in theNicholas Marriott
status line (bound to "i" and displays the current window and time by default). The same substitutions are applied as for status-left/right. - Add support for including the window index (#I), pane index (#P) and window name (#W) in the message, and status-left or status-right. - Bump protocol version. From Tiago Cunha, thanks!
2009-07-17Remove a duplicate key binding, and turn off autorepeat for up/down as it isNicholas Marriott
kind of annoying by default.
2009-07-15Make status_message_set a variadic printf-like function. No functional change -Nicholas Marriott
helpful for a couple of things coming soon.
2009-07-12Creating a key binding which replaces itself (such as "bind x bind x lsw")Nicholas Marriott
frees the command list bound to the key while it is still being executed, leading to a use after free. To prevent this, create a dead keys list and defer freeing replaced or removed key bindings until the main loop when the key binding will have finished executing. Found by Johan Friis when creating a key binding to reload his configuration file.
2009-06-01Import tmux, a terminal multiplexor allowing (among other things) a singleNicholas Marriott
terminal to be switched between several different windows and programs displayed on one terminal be detached from one terminal and moved to another. ok deraadt pirofti