summaryrefslogtreecommitdiffstats
path: root/key-bindings.c
AgeCommit message (Collapse)Author
2015-11-12Support UTF-8 key bindings by expanding the key type from int tonicm
uint64_t and converting UTF-8 to Unicode on input and the reverse on output. (This allows key bindings, there are still omissions - the largest being that the various prompts do not accept UTF-8.)
2015-11-05Pass through right click if mouse is on, from Patrick Palka.nicm
2015-10-27Use copy-mode -et= in WheelUpPane binding, from Patrick Palka.nicm
2015-10-26Default bindings for mouse wheel on status line to change window (likenicm
we had before), from Patrick Palka.
2015-10-21By popular demand add a default binding for mouse wheel up to scrollnicm
into history (if the mouse is, on of course).
2015-06-05Make it so that if a window or session target is prefixed with an =,nicm
only an exact name or index match is accepted, no special character, prefix match, or fnmatch.
2015-06-04Add support for a single "marked pane". There is one marked pane in thenicm
server at a time; it may be toggled or cleared with select-pane -m and -M (the border is highlighted). A new target '~' or '{marked}' specifies the marked pane to commands and it is the default target for the swap-pane and join-pane -s flag (this makes them much simpler to use - mark the source pane and then change to the target pane to run swapp or joinp).
2015-05-07Style spacing nits.nicm
2015-04-25Fix some char* -> char *.nicm
2015-04-21Bind mouse dragging so that it is passed through to applications if theynicm
want it rather than entering copy mode.
2015-04-20Support for multiple key tables to commands to be bound to sequences ofnicm
keys. The default key bindings become the "prefix" table and -n the "root" table. Keys may be bound in new tables with bind -T and switch-client -T used to specify the table in which the next key should be looked up. Based on a diff from Keith Amling.
2015-04-19Rewrite of tmux mouse support which was a mess. Instead of havingnicm
options for "mouse-this" and "mouse-that", mouse events may be bound as keys and there is one option "mouse" that turns on mouse support entirely (set -g mouse on). See the new MOUSE SUPPORT section of the man page for description of the key names and new flags (-t= to specify the pane or window under mouse as a target, and send-keys -M to pass through a mouse event). The default builtin bindings for the mouse are: bind -n MouseDown1Pane select-pane -t=; send-keys -M bind -n MouseDown1Status select-window -t= bind -n MouseDrag1Pane copy-mode -M bind -n MouseDrag1Border resize-pane -M To get the effect of turning mode-mouse off, do: unbind -n MouseDrag1Pane unbind -temacs-copy MouseDrag1Pane The old mouse options are now gone, set-option -q may be used to suppress warnings if mixing configuration files.
2014-10-22Fix some spacing nits.nicm
2014-10-20Instead of setting up the default keys by building the key structnicm
directly with a helper function in the cmd_entry, include a table of bind-key commands and pass them through the command parser and a temporary cmd_q. As well as being smaller, this will allow default bindings to be command sequences which will probably be needed soon.
2014-05-14Now that cmdlists are reference counted, there is no need for two-stepnicm
deletion via the dead_key_bindings tree. From Keith Amling.
2014-04-17Remove the "info" message mechanism, this was only used for about fivenicm
mostly useless and annoying messages. Change those commands to silence on success like all the others. Still accept the -q command line flag and "quiet" server option for now.
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!