aboutsummaryrefslogtreecommitdiff
path: root/key-bindings.c
Commit message (Collapse)AuthorAge
...
* Add support for simple menus usable with mouse or keyboard. New commandnicm2019-05-10
| | | | | display-menu shows a menu (bound to the mouse on status line by default) and a couple of extra formats for the default menus.
* send-keys also needs to insert key commands in the right order.nicm2019-05-09
|
* Add support for keys to jump between matching brackets - C-M-f and C-M-bnicm2019-04-29
| | | | | in emacs, % in vi. Suggested by and help from Chris Barber in GitHub issue 1666.
* Support for windows larger than visible on the attached client. This hasnicm2018-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | been a limitation for a long time. There are two new options, window-size and default-size, and a new command, resize-window. The force-width and force-height options and the session_width and session_height formats have been removed. The new window-size option tells tmux how to work out the size of windows: largest means it picks the size of the largest session, smallest the smallest session (similar to the old behaviour) and manual means that it does not automatically resize windows. The default is currently largest but this may change. aggressive-resize modifies the choice of session for largest and smallest as it did before. If a window is in a session attached to a client that is too small, only part of the window is shown. tmux attempts to keep the cursor visible, so the part of the window displayed is changed as the cursor moves (with a small delay, to try and avoid excess redrawing when applications redraw status lines or similar that are not currently visible). The offset of the visible portion of the window is shown in status-right. Drawing windows which are larger than the client is not as efficient as those which fit, particularly when the cursor moves, so it is recommended to avoid using this on slow machines or networks (set window-size to smallest or manual). The resize-window command can be used to resize a window manually. If it is used, the window-size option is automatically set to manual for the window (undo this with "setw -u window-size"). resize-window works in a similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and -A flags. -a sets the window to the size of the smallest client (what it would be if window-size was smallest) and -A the largest. For the same behaviour as force-width or force-height, use resize-window -x or -y, and "setw -u window-size" to revert to automatic sizing.. If the global window-size option is set to manual, the default-size option is used for new windows. If -x or -y is used with new-session, that sets the default-size option for the new session. The maximum size of a window is 10000x10000. But expect applications to complain and much higher memory use if making a window excessively big. The minimum size is the size required for the current layout including borders. The refresh-client command can be used to pan around a window, -U -D -L -R moves up, down, left or right and -c returns to automatic cursor tracking. The position is reset when the current window is changed.
* Add -Z to find-window as well.nicm2018-08-20
|
* Make key trees and some other bits static.nicm2018-08-02
|
* Add -Z flag to choose-tree, choose-client, choose-buffer tonicm2018-02-28
| | | | | | automatically zoom the pane when the mode is entered and unzoom when it exits, assuming the pane is not already zoomed. Add -Z to the default key bindings.
* Add a common function for spreading out cells and use it for the twonicm2017-11-15
| | | | | even layouts and to add a -E flag to select-layout to spread out cells evenly without changing parent cells.
* Add -- to some key bindings so leading -s work.nicm2017-10-05
|
* When removing a key table clear it out of clients, fixes issue withnicm2017-09-08
| | | | unbind -a reported by Thomas Sattler.
* Use brackets around prompts which looks better and matches the other modes.nicm2017-06-09
|
* Rewrite of choose mode, both to simplify and tidy the code and to addnicm2017-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | some modern features. Now the common code is in mode-tree.c, which provides an API used by the three modes now separated into window-{buffer,client,tree}.c. Buffer mode shows buffers, client mode clients and tree mode a tree of sessions, windows and panes. Each mode has a common set of key bindings plus a few that are specific to the mode. Other changes are: - each mode has a preview pane: for buffers this is the buffer content (very useful), for others it is a preview of the pane; - items may be sorted in different ways ('O' key); - multiple items may be tagged and an operation applied to all of them (for example, to delete multiple buffers at once); - in tree mode a command may be run on the selected item (session, window, pane) or on tagged items (key ':'); - displayed items may be filtered in tree mode by using a format (this is used to implement find-window) (key 'f'); - the custom format (-F) for the display is no longer available; - shortcut keys change from 0-9, a-z, A-Z which was always a bit weird with keys used for other uses to 0-9, M-a to M-z. Now that the code is simpler, other improvements will come later. Primary key bindings for each mode are documented under the commands in the man page (choose-buffer, choose-client, choose-tree). Parts written by Thomas Adam.
* Preserve search string when entering prompt again.nicm2017-05-30
|
* Insert copy mode bindings at the right place in the command queue.nicm2017-05-10
|
* Up to now, tmux sees \033\033[OA as M-Up and since we turned onnicm2017-05-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | xterm-keys by default, generates \033[1;3A instead of \033\033[OA. Unfortunately this confuses vi, which doesn't understand xterm keys and now sees Escape+Up pressed within escape-time as Escape followed by A. The issue doesn't happen in xterm itself because it gets the keys from X and can distinguish between a genuine M-Up and Escape+Up. Because xterm can, tmux can too: xterm will give us \033[1;3A (that is, kUP3) for a real M-Up and \033\033OA for Escape+Up - in fact, we can be sure any \033 preceding an xterm key is a real Escape key press because Meta would be part of the xterm key instead of a separate \033. So change tmux to recognise both sequences as M-Up for its own purposes, but generate the xterm version of M-Up only if it originally received the xterm version from the terminal. This means we will return to sending \033\033OA instead of the xterm key for terminals that do not support xterm keys themselves, but there is no practical way around this because they do not allow us to distinguish between Escape+Up and M-Up. xterm style escape sequences are now the de facto standard for these keys in any case. Problem reported by jsing@ and subsequently by Cecile Tonglet in GitHub issue 907.
* Key needs to be initialized to zero now it has flags in it.nicm2017-04-21
|
* Store state shared between multiple commands in the queue in a sharednicm2017-04-21
| | | | structure.
* Add Home and End for copy mode.nicm2017-04-05
|
* Cancel key table when switching session, unless the key is going tonicm2017-02-06
| | | | repeat. Reported by Amos Bird.
* 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.