summaryrefslogtreecommitdiffstats
path: root/cmd-copy-mode.c
AgeCommit message (Collapse)Author
2021-08-21Add args parsing callback for some future work, currently unused.nicm
2020-04-13Move cmdq_state into cmd-queue.c.nicm
2020-04-13Rename cmdq_shared to cmdq_state which will better reflect what it isnicm
(going to be) used for.
2020-04-13Store a key event not a mouse event in the shared data.nicm
2020-04-13Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make itsnicm
use more clearly defined and preparation for some future work).
2020-04-13Make struct cmd local to cmd.c and move it out of tmux.h.nicm
2020-04-10Now that copy mode copies the pane content rather than keeping anicm
reference to it, it isn't necessary that the pane in copy mode is the same as the one copying from. Add a -s flag to copy-mode to specify a different pane for the source content. This means it is possible to view two places in a pane's history at the same time in different panes, or copy from a pane's history into an editor or shell in the same pane. From Anindya Mukherjee.
2020-03-20Make the mouse_word and mouse_line formats work in copy mode and enablenicm
the default pane menu in copy mode.
2020-03-12Add a copy-mode -H flag to hide the position marker in the top right.nicm
2019-05-07Treat keys in identify mode (display-panes) specially and handle themnicm
immediately rather than queuing them (the command can block the queue which means they were not being seen until it finished which was too late). Reported by denis@ and solene@, ok solene@.
2019-03-12Allow multiple modes to be open in a pane. A stack of open modes is keptnicm
and the previous restored when the top is exited. If a mode that is already on the stack is entered, the existing instance is moved to the top as the active mode rather than being opened new.
2019-03-08Make the mode used to view command output (a variant of copy mode) usenicm
its own mode definition struct with a different init function rather than calling special setup functions.
2019-03-07Add a separate mode struct for the active window mode if any.nicm
2017-05-30Rewrite of choose mode, both to simplify and tidy the code and to addnicm
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.
2017-04-22Get rid of the extra layer of flags and cmd_prepare() and just store thenicm
CMD_FIND_* flags in the cmd_entry and call it for the command. Commands with special requirements call it themselves and update the target for hooks to use.
2017-04-21Store state shared between multiple commands in the queue in a sharednicm
structure.
2016-10-16Mass rename struct cmd_q to struct cmdq_item and related.nicm
2016-10-16Rewrite command queue handling. Each client still has a command queue,nicm
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.
2016-10-14Add CMD_AFTERHOOK flag to the easy commands that don't need any special ↵nicm
handling.
2016-10-10Add static in cmd-* and fix a few other nits.nicm
2016-05-01Use the same code for half page scrolling as full, from Michal Mazurek.nicm
2016-01-19I no longer use my SourceForge address so replace it.nicm
2016-01-02clock-mode needs CMD_PANE.nicm
2015-12-14Instead of combined flags for -c, -s, -t, split into different setsnicm
using an enum and simplify the parsing code.
2015-12-13Use member names in cmd_entry definitions so I stop getting confusednicm
about the order.
2015-12-13Instead of every command resolving the target (-t or -s) itself, preparenicm
the state (client, session, winlink, pane) for it it before entering the command. Each command provides some flags that tell the prepare step what it is expecting. This is a requirement for having hooks on commands (for example, if you hook "select-window -t1:2", the hook command should to operate on window 1:2 not whatever it thinks is the current window), and should allow some other target improvements. The old cmd_find_* functions remain for the moment but that layer will be dropped later. Joint work with Thomas Adam.
2015-09-13Add copy-mode -e to exit copy mode when scrolling off the bottom, usefulnicm
for quick view of history, from Cam Hutchison.
2015-04-21Bind mouse dragging so that it is passed through to applications if theynicm
want it rather than entering copy mode.
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.
2015-02-09Merge clock-mode command into copy-mode.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.
2013-10-10Remove the barely-used and unnecessary command check() function.nicm
2013-03-28Make copy-mode -u still scroll up if already in copy mode, handy forNicholas Marriott
people who bind it with -n.
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.
2012-07-11Make command exec functions return an enum rather than -1/0/1 values andNicholas Marriott
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.
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-08-11Handle failure to change mode, to avoid dying when switching into copyNicholas Marriott
mode when already in a different mode. Reported by "Florian".
2010-04-06Merge copy mode and output mode, dropping the latter. Idea and code fromNicholas Marriott
Micah Cowan.
2010-01-02Use the target print function for copy-mode, spotted by Tiago Cunha.Nicholas Marriott
2009-11-13Get rid of the ugly CMD_CHFLAG macro and use a const string (eg "dDU") in theNicholas Marriott
command entry structs and a couple of functions to check/set the flags.
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-18Now that pane targets (-t) are supported, switch some commands to use themNicholas Marriott
where it makes sense: clock-mode, copy-mode, scroll-mode, send-keys, send-prefix.
2009-07-26Make all messages sent between the client and server fixed size.Nicholas Marriott
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.
2009-07-13Having fixed flags for single-character getopt options is a bit hard toNicholas Marriott
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.
2009-07-13copy-mode and scroll-mode have a -u flag missing from usage, add it.Nicholas Marriott
2009-06-29Don't try to page up with scroll-mode -u or copy-mode -u unless the mode wasNicholas Marriott
successfully changed - if already in a different mode, it would corrupt the mode data.
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