summaryrefslogtreecommitdiffstats
path: root/cmd-choose-tree.c
AgeCommit message (Collapse)Author
2018-11-15Add [template] to display-panes and choose-{buffer,client,tree} usagekn
OK nicm
2018-02-28Add -Z flag to choose-tree, choose-client, choose-buffer tonicm
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.
2017-11-02Only show the first member of session groups in tree mode (-G flagnicm
disables).
2017-08-23Key (v) and flag (-N) to toggle preview in choose modes.nicm
2017-08-09Add -F to choose-tree, choose-client, choose-buffer to specify thenicm
format of each line, as well as adding a couple of formats needed for the default display.
2017-06-09Extend filters (f key) to buffer and client mode and add -f flag tonicm
specify to command.
2017-06-09Add -O option to choose-* to set initial sort order.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.
2016-10-16Mass rename struct cmd_q to struct cmdq_item and related.nicm
2016-10-10Add static in cmd-* and fix a few other nits.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-04-27Rewrite of the target resolution internals to be simpler and morenicm
consistent but with much less duplication, but keeping the same internal API. Also adds more readable aliases for some of the special tokens used in targets (eg "{start}" instead of "^"). Some behaviours may have changed, for example prefix matches now happen before fnmatch.
2014-10-20Move template defines back into .c files.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-04-22When using choose-tree -u, start with the current windowNicholas Marriott
highlighted. From Thomas Adam.
2013-04-22Get session of -t window rather than client's window.Nicholas Marriott
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-21Make choose-tree actually work again.Nicholas Marriott
2013-03-21Run session command before window in choose-tree.Nicholas Marriott
2013-03-21Allow choose commands to be used outside tmux, so long as at least oneNicholas Marriott
client is attached.
2013-01-17Fix some blank line nits.Nicholas Marriott
2012-12-24Add a -u flag to choose-tree to start uncollapsed, from Raghavendra DNicholas Marriott
Prabhu.
2012-09-24Use ACS characters for choose-tree arrows based on diff from RomainNicholas Marriott
Francoise.
2012-09-03Use the right index when adding item in choose-tree, from Thomas Adam.Nicholas Marriott
2012-09-03Remove an unused variable.Nicholas Marriott
2012-09-03Change format of choose-tree arrows slightly, from Romain Francoise.Nicholas Marriott
2012-08-14Use a separate define for each default format template and strip clutterNicholas Marriott
from the choose-tree defaults.
2012-08-11Fix a return type.Nicholas Marriott
2012-07-12Nuke unused variable from Thomas Adam.Nicholas Marriott
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.
2012-07-10xfree is not particularly helpful, remove it. From Thomas Adam.Nicholas Marriott
2012-07-09Fix choose-tree usage string.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.