aboutsummaryrefslogtreecommitdiff
path: root/key-bindings.c
Commit message (Collapse)AuthorAge
...
* Add support for custom command aliases, this is an array option whichnicm2017-01-24
| | | | | contains items of the form "alias=command". This is consulted when an unknown command is parsed.
* Revert WIP parts of previous I didn't mean to commit yet.nicm2017-01-16
|
* getopt() has a struct option so just return to using options_entry.nicm2017-01-16
|
* It is silly for cmd_list_parse to return an integer error when it couldnicm2017-01-15
| | | | just return NULL.
* Incremental search in copy mode (on for emacs keys by default) - muchnicm2017-01-06
| | | | | | the same as normal searching but updates the cursor position and marked search terms as you type. C-r and C-s in the prompt repeat the search, once finished searching (with Enter), N and n work as before.
* Make prefix work in all tables (except the prefix table). Users who wantnicm2016-12-07
| | | | | | to avoid this can set prefix to "none" and bind send-prefix themselves. Allows C-b t be bound in the copy mode tables again, pointed out by millert@.
* Fix so that we work out the right pane from mouse events - we were doingnicm2016-11-24
| | | | | | | | | | so too early, before the mouse event was necessarily valid, so could end up using the pane from the previous mouse event, or the active pane. It is important that we use the right pane now that different panes can have different key tables (for copy mode). Fixes problem reported by Greg Hurrell.
* For mouse keys, use the mouse pane as the default current pane.nicm2016-11-23
|
* Add %%% to substitute with quotes escaped (convert " to \"). Use thisnicm2016-10-21
| | | | | for the prompts in copy mode. Fixes problems with jumping to ' reported by Theo Buehler.
* Do not have a default binding for C-b in copy-mode-vi or it conflictsnicm2016-10-19
| | | | with the default prefix. Reported by natano@.
* Mass rename struct cmd_q to struct cmdq_item and related.nicm2016-10-16
|
* Rewrite command queue handling. Each client still has a command queue,nicm2016-10-16
| | | | | | | | | | | | | | | but there is also now a global command queue. Instead of command queues being dispatched on demand from wherever the command happens to be added, they are now all dispatched from the top level server loop. Command queues may now also include callbacks as well as commands, and items may be inserted after the current command as well as at the end. This all makes command queues significantly more predictable and easier to use, and avoids the complex multiple nested command queues used by source-file, if-shell and friends. A mass rename of struct cmdq to a better name (cmdq_item probably) is coming.
* The repeat prompt in both emacs and vi (and the old one in tmux) doesn'tnicm2016-10-12
| | | | | | support line editing and instead executes a command as soon as a non-number key is pressed. Add a -N flag to command-prompt for the same in copy mode. Reported by Theo Buehler.
* Support double and triple clicks (they are cumulative, so double isnicm2016-10-11
| | | | | fired then triple), and use for select-word and select-line in copy mode. Inspired by a different solution from Omar Sandoval.
* Fundamental change to how copy mode key bindings work:nicm2016-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | The vi-copy and emacs-copy mode key tables are gone, and instead copy mode commands are bound in one of two normal key tables ("copy-mode" or "copy-mode-vi"). Keys are bound to "send-keys -X copy-mode-command". So: bind -temacs-copy C-Up scroll-up bind -temacs-copy -R5 WheelUpPane scroll-up Becomes: bind -Tcopy-mode C-Up send -X scroll-up bind -Tcopy-mode WheelUpPane send -N5 -X scroll-up This allows the full command parser and command set to be used - for example, we can use the normal command prompt for searching, jumping, and so on instead of a custom one: bind -Tcopy-mode C-r command-prompt -p'search up' "send -X search-backward '%%'" command-prompt also gets a -1 option to only require on key press, which is needed for jumping. The plan is to get rid of mode keys entirely, so more to come eventually.
* Remove some more unused variables, and use RB_FOREACH_SAFE innicm2016-03-01
| | | | key_bindings_unref_table.
* I no longer use my SourceForge address so replace it.nicm2016-01-19
|
* Support UTF-8 key bindings by expanding the key type from int tonicm2015-11-12
| | | | | | 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.)
* Pass through right click if mouse is on, from Patrick Palka.nicm2015-11-05
|
* Use copy-mode -et= in WheelUpPane binding, from Patrick Palka.nicm2015-10-27
|
* Default bindings for mouse wheel on status line to change window (likenicm2015-10-26
| | | | we had before), from Patrick Palka.
* By popular demand add a default binding for mouse wheel up to scrollnicm2015-10-21
| | | | into history (if the mouse is, on of course).
* Make it so that if a window or session target is prefixed with an =,nicm2015-06-05
| | | | | only an exact name or index match is accepted, no special character, prefix match, or fnmatch.
* Add support for a single "marked pane". There is one marked pane in thenicm2015-06-04
| | | | | | | | | 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).
* Style spacing nits.nicm2015-05-07
|
* Fix some char* -> char *.nicm2015-04-25
|
* Bind mouse dragging so that it is passed through to applications if theynicm2015-04-21
| | | | want it rather than entering copy mode.
* Support for multiple key tables to commands to be bound to sequences ofnicm2015-04-20
| | | | | | | 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.
* Rewrite of tmux mouse support which was a mess. Instead of havingnicm2015-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix some spacing nits.nicm2014-10-22
|
* Instead of setting up the default keys by building the key structnicm2014-10-20
| | | | | | | | | 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.
* Now that cmdlists are reference counted, there is no need for two-stepnicm2014-05-14
| | | | deletion via the dead_key_bindings tree. From Keith Amling.
* Remove the "info" message mechanism, this was only used for about fivenicm2014-04-17
| | | | | | 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.
* Add resize-pane -Z to temporary zoom the active pane to occupy the fullNicholas Marriott2013-03-24
| | | | | | | | | | | | | | 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.
* Add a command queue to standardize and simplify commands that call otherNicholas Marriott2013-03-24
| | | | | | | | | | | | | | | | | | | | | | 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.
* Need to set clients in context before changing their reference count.Nicholas Marriott2013-03-22
|
* Remove unnecessary initializers of cmd_ctx.Nicholas Marriott2013-03-22
|
* Remove the layout undo/redo code which never really worked.Nicholas Marriott2013-01-17
|
* xfree is not particularly helpful, remove it. From Thomas Adam.Nicholas Marriott2012-07-10
|
* Add choose-tree command to show windows and sessions in the sameNicholas Marriott2012-07-08
| | | | | list. Change choose-window and -session to use the same code. From Thomas Adam.
* Add a couple of NULL pointer checks to key binding functions, fromNicholas Marriott2012-06-18
| | | | jspenguin on SF bug 3535531.
* Add a layout history which can be stepped through with select-layout -uNicholas Marriott2012-04-01
| | | | and -U commands (bound to 'u' and 'U' by default).
* Use RB trees not SPLAY.Nicholas Marriott2012-01-21
|
* Include the existing window and session name in the prompt when renamingNicholas Marriott2011-07-03
| | | | and add a new key binding ($) for rename session. From Tiago Cunha.
* Clean up and simplify tmux command argument parsing.Nicholas Marriott2011-01-04
| | | | | | | | | | | | | | | | | | | 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.
* Track the last session for a client and add a flag to switch-client andNicholas Marriott2010-12-11
| | | | a key binding (L) to move a client back to its last session.
* Add a last-pane command (bound to ; by default). Requested ages ago byNicholas Marriott2010-10-23
| | | | somebody whose name I have forgotten.
* Add -n and -p flags to switch-client to move to the next and previousNicholas Marriott2010-09-08
| | | | | | | session (yes, it doesn't match window/pane, but so what, nor does switch-client). Based on a diff long ago from "edsouza".
* Setting the cmdlist pointer in the bind-key to NULL to prevent it being freedNicholas Marriott2010-06-26
| | | | | | | | | | | 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@.
* Add a choose-buffer command for easier use of the paste buffer stack.Nicholas Marriott2010-06-21
|