OpenBSD CVS

CVS log for src/usr.bin/tmux/cmd-choose-tree.c


[BACK] Up to [local] / src / usr.bin / tmux

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.51 / (download) - annotate - [select for diffs], Sat Jun 4 07:42:07 2022 UTC (23 months, 2 weeks ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored)

When picking a buffer because one isn't specified by the user, ignore
named buffers. GitHub issue 3212 from David le Blanc.

Revision 1.50 / (download) - annotate - [select for diffs], Fri Aug 27 17:25:55 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.49: +15 -5 lines
Diff to previous 1.49 (colored)

Replace %% in command lists (by copying them) for template arguments ,
this means they can be used with {} as well. Also make argument
processing from an existing vector preserve commands. GitHub issue 2858.

Revision 1.49 / (download) - annotate - [select for diffs], Sat Aug 21 10:22:38 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.48: +5 -5 lines
Diff to previous 1.48 (colored)

Add args parsing callback for some future work, currently unused.

Revision 1.48 / (download) - annotate - [select for diffs], Mon Apr 12 06:50:25 2021 UTC (3 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.47: +10 -10 lines
Diff to previous 1.47 (colored)

Permit shortcut keys in buffer, client, tree modes to be configured with
a format; the default remains the line number. GitHub issue 2636.

Revision 1.47 / (download) - annotate - [select for diffs], Sat May 16 16:02:24 2020 UTC (4 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.46: +17 -2 lines
Diff to previous 1.46 (colored)

Add a customize mode where keys and options may be browsed and changed,
includes adding a brief description of each option. Bound to "C" by
default.

Revision 1.46 / (download) - annotate - [select for diffs], Mon Apr 13 10:59:58 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.45: +4 -3 lines
Diff to previous 1.45 (colored)

Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make its
use more clearly defined and preparation for some future work).

Revision 1.45 / (download) - annotate - [select for diffs], Mon Apr 13 08:26:27 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.44: +4 -4 lines
Diff to previous 1.44 (colored)

Make struct cmd local to cmd.c and move it out of tmux.h.

Revision 1.44 / (download) - annotate - [select for diffs], Fri Apr 10 07:44:26 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

Now that copy mode copies the pane content rather than keeping a
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.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Aug 16 11:49:12 2019 UTC (4 years, 9 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.42: +7 -7 lines
Diff to previous 1.42 (colored)

Add a flag to reverse sort in the various choose modes, from Benjamin
Poirier in GitHub issue 1875.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Nov 15 10:38:53 2018 UTC (5 years, 6 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.41: +4 -4 lines
Diff to previous 1.41 (colored)

Add [template] to display-panes and choose-{buffer,client,tree} usage

OK nicm

Revision 1.41 / (download) - annotate - [select for diffs], Wed Feb 28 08:55:44 2018 UTC (6 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.40: +4 -4 lines
Diff to previous 1.40 (colored)

Add -Z flag to choose-tree, choose-client, choose-buffer to
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.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Nov 2 18:27:35 2017 UTC (6 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (colored)

Only show the first member of session groups in tree mode (-G flag
disables).

Revision 1.39 / (download) - annotate - [select for diffs], Wed Aug 23 09:39:11 2017 UTC (6 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.38: +7 -7 lines
Diff to previous 1.38 (colored)

Key (v) and flag (-N) to toggle preview in choose modes.

Revision 1.38 / (download) - annotate - [select for diffs], Wed Aug 9 11:43:45 2017 UTC (6 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.37: +10 -7 lines
Diff to previous 1.37 (colored)

Add -F to choose-tree, choose-client, choose-buffer to specify the
format of each line, as well as adding a couple of formats needed for
the default display.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jun 9 16:01:39 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.36: +7 -7 lines
Diff to previous 1.36 (colored)

Extend filters (f key) to buffer and client mode and add -f flag to
specify to command.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jun 9 15:29:15 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.35: +7 -7 lines
Diff to previous 1.35 (colored)

Add -O option to choose-* to set initial sort order.

Revision 1.35 / (download) - annotate - [select for diffs], Tue May 30 21:44:59 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.34: +28 -193 lines
Diff to previous 1.34 (colored)

Rewrite of choose mode, both to simplify and tidy the code and to add
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.

Revision 1.34 / (download) - annotate - [select for diffs], Sat Apr 22 10:22:39 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.33: +7 -7 lines
Diff to previous 1.33 (colored)

Get rid of the extra layer of flags and cmd_prepare() and just store the
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.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Oct 16 19:04:05 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.32: +7 -7 lines
Diff to previous 1.32 (colored)

Mass rename struct cmd_q to struct cmdq_item and related.

Revision 1.32 / (download) - annotate - [select for diffs], Mon Oct 10 21:51:39 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored)

Add static in cmd-* and fix a few other nits.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Dec 14 00:31:54 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.30: +10 -5 lines
Diff to previous 1.30 (colored)

Instead of combined flags for -c, -s, -t, split into different sets
using an enum and simplify the parsing code.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Dec 13 21:53:57 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.29: +27 -17 lines
Diff to previous 1.29 (colored)

Use member names in cmd_entry definitions so I stop getting confused
about the order.

Revision 1.29 / (download) - annotate - [select for diffs], Sun Dec 13 14:32:38 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.28: +8 -11 lines
Diff to previous 1.28 (colored)

Instead of every command resolving the target (-t or -s) itself, prepare
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.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Apr 27 16:25:57 2015 UTC (9 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

Rewrite of the target resolution internals to be simpler and more
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.

Revision 1.27 / (download) - annotate - [select for diffs], Mon Oct 20 23:35:28 2014 UTC (9 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.26: +10 -1 lines
Diff to previous 1.26 (colored)

Move template defines back into .c files.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Oct 20 22:29:25 2014 UTC (9 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.25: +1 -4 lines
Diff to previous 1.25 (colored)

Instead of setting up the default keys by building the key struct
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.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Oct 10 12:00:18 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.24: +1 -4 lines
Diff to previous 1.24 (colored)

Remove the barely-used and unnecessary command check() function.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Oct 10 11:58:52 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.23: +1 -2 lines
Diff to previous 1.23 (colored)

choose-tree: Reset top when toggling items

When choose-tree is told to expand/collapse items (especially when first
rendering collapsed to just show sessions), ensure that in addition to
setting the selected item, that the item itself appears on the bottom of
the screen, rather than off screen.

This was causing rendering glitches when a very small tmux window tried
to render a list of items in choose-tree much larger than itself, and
the selected item appeared off screen, and didn't show the selection
until the selection had wrapped around to the top of the screen.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Apr 22 22:17:29 2013 UTC (11 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.22: +5 -2 lines
Diff to previous 1.22 (colored)

When using choose-tree -u, start with the current window
highlighted. From Thomas Adam.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Apr 22 16:34:53 2013 UTC (11 years ago) by nicm
Branch: MAIN
Changes since 1.21: +2 -5 lines
Diff to previous 1.21 (colored)

Get session of -t window rather than client's window.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Mar 24 09:54:10 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.20: +6 -6 lines
Diff to previous 1.20 (colored)

Add a command queue to standardize and simplify commands that call other
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.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Mar 21 16:53:12 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.19: +4 -3 lines
Diff to previous 1.19 (colored)

Make choose-tree actually work again.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Mar 21 16:23:07 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored)

Run session command before window in choose-tree.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Mar 21 16:19:25 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Fix constness of cmd_template_replace, window_choose_add_item and
window_choose_add_window.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Mar 21 16:17:35 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Fix choose-tree usage.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Mar 21 16:09:59 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.15: +8 -6 lines
Diff to previous 1.15 (colored)

Allow choose commands to be used outside tmux, so long as at least one
client is attached.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Mar 21 16:09:17 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

Remove free callback for window_choose_data objects.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Mar 21 16:08:24 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.13: +2 -30 lines
Diff to previous 1.13 (colored)

Miscellaneous tidying of choose API, including:

- rename client and session to start_client and start_session in
  window_choose_data struct. also add TREE_OTHER define and reorder
  the struct
- rename window_choose_ctx to window_choose_data_run
- don't pass a cmd_ctx into window_choose_create (will let it use a
  different client later). instead take type, session, client
- add window_choose_data_free and use it to dispose of wcd rather than
  each cmd-*.c doing it individually
- change so ref counting is done by wcd_add and wcd_free rather than
  callers
- also add a ref to tree_session
- all the callbacks except choose-client and find-window are the same so
  remove them and add window_choose_default_callback
- reorder/rename some other bits and pieces for tidyness

Revision 1.13 / (download) - annotate - [select for diffs], Thu Jan 17 03:51:21 2013 UTC (11 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

Fix some blank line nits.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Dec 24 12:25:52 2012 UTC (11 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.11: +6 -3 lines
Diff to previous 1.11 (colored)

Add a -u flag to choose-tree to start uncollapsed, from Raghavendra D
Prabhu.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Sep 24 12:53:55 2012 UTC (11 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.10: +5 -3 lines
Diff to previous 1.10 (colored)

Use ACS characters for choose-tree arrows based on diff from Romain
Francoise.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Sep 3 12:24:25 2012 UTC (11 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.9: +3 -2 lines
Diff to previous 1.9 (colored)

Use the right index when adding item in choose-tree, from Thomas Adam.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Sep 3 09:36:07 2012 UTC (11 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.8: +1 -3 lines
Diff to previous 1.8 (colored)

Remove an unused variable.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Sep 3 09:01:16 2012 UTC (11 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.7: +29 -15 lines
Diff to previous 1.7 (colored)

Change format of choose-tree arrows slightly, from Romain Francoise.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Aug 14 08:51:53 2012 UTC (11 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.6: +5 -7 lines
Diff to previous 1.6 (colored)

Use a separate define for each default format template and strip clutter
from the choose-tree defaults.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Aug 11 06:46:47 2012 UTC (11 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

Fix a return type.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jul 12 13:03:42 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.4: +1 -3 lines
Diff to previous 1.4 (colored)

Nuke unused variable from Thomas Adam.

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jul 11 07:10:15 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.3: +6 -7 lines
Diff to previous 1.3 (colored)

Make command exec functions return an enum rather than -1/0/1 values and
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.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jul 10 11:53:01 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.2: +7 -7 lines
Diff to previous 1.2 (colored)

xfree is not particularly helpful, remove it. From Thomas Adam.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jul 9 07:08:03 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored)

Fix choose-tree usage string.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Jul 8 16:04:38 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN

Add choose-tree command to show windows and sessions in the same
list. Change choose-window and -session to use the same code. From
Thomas Adam.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.