summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-list-keys.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Break the argument escaping code into a separate function and use it tonicm2019-05-231-6/+9
| | | | escape key bindings in list-keys. Also escape ~ and ; and $ properly.
* Make key trees and some other bits static.nicm2018-08-021-7/+20
|
* In order that people can use formats like #D in #() in the status linenicm2017-05-011-2/+2
| | | | | | | | | | | | | | and not have to wait for an update when they change pane, we allow commands to run more than once a second if the expanded form changes. Unfortunately this can mean them being run far too often (pretty much continually) when multiple clients exist, because some formats (including #D) will always differ between clients. To avoid this, give each client its own tree of jobs which means that the same command will be different instances for each client - similar to how we have the tag to separate commands for different panes. GitHub issue 889; test case reported by Paul Johnson.
* Store state shared between multiple commands in the queue in a sharednicm2017-04-211-3/+3
| | | | structure.
* Add a window or pane id "tag" to each format tree and use it to separatenicm2017-02-031-2/+2
| | | | | | jobs, this means that if the same job is used for different windows or panes (for example in pane-border-format), it will be run separately for each pane.
* Fixed keys for choose mode, and remove the last mode keys bits.nicm2017-01-241-41/+3
|
* Mass rename struct cmd_q to struct cmdq_item and related.nicm2016-10-161-24/+27
|
* Add CMD_AFTERHOOK flag to the easy commands that don't need any special handling.nicm2016-10-141-3/+3
|
* Drop the edit mode key tables and just use fixed key bindings for thenicm2016-10-121-19/+7
| | | | command prompt.
* Fundamental change to how copy mode key bindings work:nicm2016-10-111-21/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Allow repeat count to be specified in mode key tables with bind-key -R,nicm2016-09-121-10/+23
| | | | | and set the default repeat count to 5 for WheelUp and WheelDown in copy-mode.
* Add -F to list-commands.nicm2016-06-151-16/+39
|
* I no longer use my SourceForge address so replace it.nicm2016-01-191-2/+2
|
* Allow list-keys and list-commands to be run without a running server.nicm2015-12-151-3/+3
|
* Use member names in cmd_entry definitions so I stop getting confusednicm2015-12-131-11/+17
| | | | about the order.
* Do not set a limit on the length of commands when printing them.nicm2015-11-271-7/+4
|
* Use __unused rather than rolling our own.nicm2015-11-181-4/+4
|
* Add utf8_padcstr and use it to align columns in list-keys.nicm2015-11-121-11/+18
|
* Support UTF-8 key bindings by expanding the key type from int tonicm2015-11-121-5/+10
| | | | | | 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.)
* Handle unknown keys more gracefully, return a string instead of NULL.nicm2015-10-261-9/+1
|
* Support for multiple key tables to commands to be bound to sequences ofnicm2015-04-201-38/+50
| | | | | | | 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.
* Tidy up some includes.nicm2014-10-201-2/+2
|
* Move list-commands into list-keys.nicm2014-10-201-1/+33
|
* Instead of setting up the default keys by building the key structnicm2014-10-201-2/+1
| | | | | | | | | 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.
* Remove the barely-used and unnecessary command check() function.nicm2013-10-101-2/+1
|
* Add a command queue to standardize and simplify commands that call othernicm2013-03-241-9/+9
| | | | | | | | | | | | | | | | | | | | | | 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.
* Add copy-pipe mode command to copy selection and also pipe to a command.nicm2013-03-221-3/+6
|
* Fix some function prototypes from Helmut Tessarek.nicm2012-10-151-2/+2
|
* Make command exec functions return an enum rather than -1/0/1 values andnicm2012-07-111-8/+7
| | | | | | add a new value to mean "leave client running but don't attach" to fix problems with using some commands in a command sequence. Most of the work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.
* Use RB trees not SPLAY.nicm2012-01-211-5/+5
|
* Reset flags on every loop or it is displayed too often, from Chrisnicm2011-12-271-2/+2
| | | | Johnsen.
* flags[] should be initialized. From Thomas Adam.nicm2011-07-081-1/+3
|
* Change the list-keys format so that it shows the keys using actual tmuxnicm2011-07-041-22/+34
| | | | | commands which should be able to be directly copied into the config file. From Markus Schnalke, tweaked by me.
* Clean up and simplify tmux command argument parsing.nicm2011-01-041-12/+13
| | | | | | | | | | | | | | | | | | | 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.
* Mark repeating keys with "(repeat)" in the key list.nicm2010-10-201-1/+6
|
* Massive spaces->tabs and trailing whitespace cleanup, hopefully for the lastnicm2009-12-031-2/+2
| | | | | time now I've configured emacs to make them displayed in really annoying colours...
* Mark -n keys with (no prefix) rather than [].nicm2009-11-181-5/+7
|
* Get rid of the ugly CMD_CHFLAG macro and use a const string (eg "dDU") in thenicm2009-11-131-2/+2
| | | | command entry structs and a couple of functions to check/set the flags.
* key_string_lookup_key uses a static buffer, so copy its output into the workingnicm2009-11-051-9/+11
| | | | | buffer before calling the command print function which can also use it (eg send-keys).
* Final pieces of mode key rebinding: bind-key and unbind-key now accept a -tnicm2009-07-281-6/+2
| | | | argument to modify a table.
* Next step towards customisable mode keys: build each default table of keys intonicm2009-07-281-7/+58
| | | | | | a named tree on start and use that for lookups. Also add command to string translation tables and modify list-keys to show the the mode key bindings (new -t argument).
* Make all messages sent between the client and server fixed size.nicm2009-07-261-3/+1
| | | | | | | | | | | | | | This is the first of two changes to make the protocol more resilient and less sensitive to other changes in the code, particularly with commands. The client now packs argv into a buffer and sends it to the server for parsing, rather than doing it itself and sending the parsed command data. As a side-effect this also removes a lot of now-unused command marshalling code. Mixing a server without this change and a client with or vice versa will cause tmux to hang or crash, please ensure that tmux is entirely killed before upgrading.
* Permit commands to be bound to key presses without the prefix key first. Thenicm2009-07-241-7/+13
| | | | | new -n flag to bind-key and unbind-key sets or removes these bindings, and list-key shows them in []s.
* Adjust field width to fit longest key when listing.nicm2009-07-211-2/+17
|
* Having fixed flags for single-character getopt options is a bit hard tonicm2009-07-131-2/+2
| | | | | | | | | maintain and is only going to get worse as more are used. So instead, add a new uint64_t member to cmd_entry which is a bitmask of upper and lowercase options accepted by the command. This means new single character options can be used without the need to add it explicitly to the list.
* Import tmux, a terminal multiplexor allowing (among other things) a singlenicm2009-06-011-0/+59
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