OpenBSD CVS

CVS log for src/usr.bin/tmux/menu.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.52 / (download) - annotate - [select for diffs], Tue Aug 15 07:01:47 2023 UTC (9 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.51: +33 -31 lines
Diff to previous 1.51 (colored)

Add an option menu-selected-style to configure the currently selected
menu item, from Alexis Hildebrandt.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Aug 8 08:08:47 2023 UTC (9 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.50: +46 -7 lines
Diff to previous 1.50 (colored)

Add options and flags for menu styles similar to those existing for
popups, from Alexis Hildebrandt. GitHub issue 3650.

Revision 1.50 / (download) - annotate - [select for diffs], Tue Aug 8 07:41:04 2023 UTC (9 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.49: +3 -2 lines
Diff to previous 1.49 (colored)

Extend the menu drawing function to support custom characters and
styles, from Alexis Hildebrandt.

Revision 1.49 / (download) - annotate - [select for diffs], Sun Feb 5 21:26:48 2023 UTC (15 months, 1 week ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.48: +3 -1 lines
Diff to previous 1.48 (colored)

Do not allow multiple line separators in a row.

Revision 1.48 / (download) - annotate - [select for diffs], Fri Jan 20 21:36:00 2023 UTC (15 months, 4 weeks ago) by nicm
Branch: MAIN
Changes since 1.47: +40 -19 lines
Diff to previous 1.47 (colored)

Add a flag to display-menu to select the manu item chosen first, GitHub
issue 3442.

Revision 1.47 / (download) - annotate - [select for diffs], Thu Aug 4 12:06:09 2022 UTC (21 months, 2 weeks ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.46: +51 -14 lines
Diff to previous 1.46 (colored)

Change g and G to go to top and bottom of menu, GitHub issue 3286.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Jun 16 13:27:39 2022 UTC (23 months ago) by nicm
Branch: MAIN
Changes since 1.45: +8 -3 lines
Diff to previous 1.45 (colored)

Keep cursor on selected item on menu (useful for blind people), GitHub
issue 3225.

Revision 1.45 / (download) - annotate - [select for diffs], Tue May 31 10:22:42 2022 UTC (23 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.44: +9 -7 lines
Diff to previous 1.44 (colored)

Trim menu item text correctly, GitHub issue 3197.

Revision 1.44 / (download) - annotate - [select for diffs], Wed Feb 16 18:55:05 2022 UTC (2 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.43: +4 -4 lines
Diff to previous 1.43 (colored)

Support more mouse buttons when the terminal sends them, GitHub issue
3055.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Feb 1 18:12:20 2022 UTC (2 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.42: +1 -3 lines
Diff to previous 1.42 (colored)

A menu must be shown on a client, so always give the client when adding
the items. Also fix mode menus.

Revision 1.42 / (download) - annotate - [select for diffs], Tue Feb 1 11:52:08 2022 UTC (2 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.41: +3 -1 lines
Diff to previous 1.41 (colored)

Do not overflow width when not enough space.

Revision 1.41 / (download) - annotate - [select for diffs], Thu Nov 11 09:22:33 2021 UTC (2 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.40: +15 -11 lines
Diff to previous 1.40 (colored)

If trimming menu item text, show key if it would take up less than a
quarter of the space; from Alexis Hildebrandt.

Also new sentence, new line in tmux.1, from jmc.

Revision 1.40 / (download) - annotate - [select for diffs], Fri Oct 22 17:12:50 2021 UTC (2 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.39: +25 -5 lines
Diff to previous 1.39 (colored)

Remove key and trim text if menu cannot fit in available space, based on
a change from Alexis Hildebrandt.

Revision 1.39 / (download) - annotate - [select for diffs], Mon Oct 18 09:48:35 2021 UTC (2 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.38: +3 -1 lines
Diff to previous 1.38 (colored)

Fix menu width containing disabled items, from Alexis Hildebrandt in
GitHub issue 2935.

Revision 1.38 / (download) - annotate - [select for diffs], Mon Oct 11 13:27:50 2021 UTC (2 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.37: +7 -8 lines
Diff to previous 1.37 (colored)

Make positions hidden by overlays range-based rather than character-based,
from Anindya Mukherjee.

Revision 1.37 / (download) - annotate - [select for diffs], Thu Sep 9 19:37:17 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Turn on both button and all mouse modes for menus since some terminals
only support the former.

Revision 1.36 / (download) - annotate - [select for diffs], Thu Sep 9 06:57:48 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

Fix parsing of aliases again (GitHub issue 2842), also make argument
parsing a bit simpler and fix the names of some client flags.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Aug 13 18:54:54 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.34: +43 -16 lines
Diff to previous 1.34 (colored)

Add a menu when a popup is present (mouse only for now).

Revision 1.34 / (download) - annotate - [select for diffs], Wed Jul 21 08:06:36 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

Do not close popups on resize, instead adjust them to fit, from Anindya
Mukherjee.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Oct 30 12:00:01 2020 UTC (3 years, 6 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.32: +5 -4 lines
Diff to previous 1.32 (colored)

Do not allow disabled items to be selected.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Oct 30 08:55:56 2020 UTC (3 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.31: +19 -5 lines
Diff to previous 1.31 (colored)

Add a -O flag to display-menu to change the mouse behaviour and not
close the menu when the mouse is released, from teo_paul1 at yahoo dot
com.

Revision 1.31 / (download) - annotate - [select for diffs], Wed Sep 16 18:37:55 2020 UTC (3 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

Fix some warnings, GitHub issue 2382.

Revision 1.30 / (download) - annotate - [select for diffs], Mon May 25 11:59:50 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.29: +2 -1 lines
Diff to previous 1.29 (colored)

Include title for the width of the menu.

Revision 1.29 / (download) - annotate - [select for diffs], Sat May 16 16:35:13 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

Separate key flags and modifiers, log key flags, make the "xterm" flag
more explicit and fix M- keys with a leading escape.

Revision 1.28 / (download) - annotate - [select for diffs], Sat May 16 15:38:14 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

Try to search the entire history first for up to 200 ms so a search
count can be shown. If it takes too long, search the visible text only.

Revision 1.27 / (download) - annotate - [select for diffs], Sat May 16 15:34:08 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.26: +10 -8 lines
Diff to previous 1.26 (colored)

Do not hoke into struct window_pane from the tty code and instead set
everything up in tty_ctx. Provide a way to initialize the tty_ctx from a
callback and use it to let popups draw directly through input_parse in
the same way as panes do, rather than forcing a full redraw on every
change.

Revision 1.26 / (download) - annotate - [select for diffs], Sat May 16 15:06:03 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.25: +36 -1 lines
Diff to previous 1.25 (colored)

Improve command prompt completion:

- Show a menu with completions if there are multiple.

- Don't complete argument stuff (options, layouts) at start of text.

- For -t and -s, if there is no : then complete sessions but if there is
  a :, show a menu of all windows in the session rather than trying to
  complete the window name which is a bit useless if there are
  duplicates.

Revision 1.25 / (download) - annotate - [select for diffs], Sat May 16 15:01:31 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.24: +2 -3 lines
Diff to previous 1.24 (colored)

Drop having a separate type for style options and make them all strings,
which allows formats to be expanded. Any styles without a '#{' are still
validated when they are set but any with a '#{' are not. Formats are not
expanded usefully in many cases yet, that will be changed later.

To make this work, a few other changes:

- set-option -a with a style option automatically appends a ",".

- OSC 10 and 11 don't set the window-style option anymore, instead the
  fg and bg are stored in the pane struct and act as the defaults that
  can be overridden by window-style.

- status-fg and -bg now override status-style instead of trying to keep
  them in sync.

Revision 1.24 / (download) - annotate - [select for diffs], Sat May 16 14:53:23 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored)

Use a grid cell not a style for the pane style.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Apr 16 17:20:23 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.22: +15 -2 lines
Diff to previous 1.22 (colored)

Start menu with top item selected if no mouse, GitHub issue 2169.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Apr 15 16:11:23 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.21: +6 -2 lines
Diff to previous 1.21 (colored)

Use mode-style for selected items, like choose modes. GitHub issue 2166.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Apr 13 18:59:41 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.20: +17 -25 lines
Diff to previous 1.20 (colored)

Add helpers for the simple case of parse string and add to command queue.

Revision 1.20 / (download) - annotate - [select for diffs], Mon Apr 13 15:55:51 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.19: +5 -2 lines
Diff to previous 1.19 (colored)

When adding a list of commands to the queue, instead of automatically
creating a new state for each group of commands, require the caller to
create one and use it for all the commands in the list. This means the
current target works even with list with multiple groups (which can
happen if they are defined with newlines).

Revision 1.19 / (download) - annotate - [select for diffs], Mon Apr 13 14:46:04 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

Move cmdq_state into cmd-queue.c.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Apr 13 14:04:25 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Rename cmdq_shared to cmdq_state which will better reflect what it is
(going to be) used for.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Apr 13 13:42:35 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Store a key event not a mouse event in the shared data.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Apr 13 10:59:58 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Tue Mar 24 08:09:44 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.14: +13 -6 lines
Diff to previous 1.14 (colored)

Add support for overlay popup boxes to show text or output temporarily
above the normal layout. These work similarly to menus and are created
with the display-popup command.

Revision 1.14 / (download) - annotate - [select for diffs], Fri Mar 20 17:26:14 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.13: +5 -1 lines
Diff to previous 1.13 (colored)

Fix positioning of menu in choose modes and a couple of keys in tree mode.

Revision 1.13 / (download) - annotate - [select for diffs], Thu Mar 19 14:23:58 2020 UTC (4 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.12: +2 -6 lines
Diff to previous 1.12 (colored)

Little bit of tidying.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Sep 16 13:27:14 2019 UTC (4 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.11: +5 -2 lines
Diff to previous 1.11 (colored)

Change menu key bindings to Up and Down and also close it on any mouse
press if opened by key.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jul 9 12:44:47 2019 UTC (4 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.10: +12 -10 lines
Diff to previous 1.10 (colored)

Add j and k for navigation in menus, GitHub issue 1828.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jun 18 11:08:42 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Add a cmdq_continue function rather than twiddling the flag directly.

Revision 1.9 / (download) - annotate - [select for diffs], Tue May 28 09:50:54 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.8: +17 -7 lines
Diff to previous 1.8 (colored)

Allow menu items to be disabled by putting a - at the start of their
name, rather than just including #[dim] which still allowed them to be
chosen.

Revision 1.8 / (download) - annotate - [select for diffs], Tue May 28 07:18:42 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.7: +45 -73 lines
Diff to previous 1.7 (colored)

Change display-menu from taking a single string to a set of arguments,
which is much easier to work with. Based on a diff from Avi Halachmi.

Revision 1.7 / (download) - annotate - [select for diffs], Sun May 26 18:19:52 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

Do not accept choice unless mouse has actually moved before.

Revision 1.6 / (download) - annotate - [select for diffs], Sun May 26 17:34:45 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.5: +31 -19 lines
Diff to previous 1.5 (colored)

Add formats for word and line under the mouse and use them to add some
items to the pane menu.

Revision 1.5 / (download) - annotate - [select for diffs], Thu May 23 11:13:30 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.4: +18 -19 lines
Diff to previous 1.4 (colored)

Replace the split parser code (cfg.c and cmd-string.c) with a single
parser using yacc(1). This is a major change but is clearer and simpler
and allows some edge cases to be made more consistent, as well as
tidying up how aliases are handled. It will also allow some further
improvements later.

Entirely the same parser is now used for parsing the configuration file
and for string commands. This means that constructs previously only
available in .tmux.conf, such as %if, can now be used in string commands
(for example, those given to if-shell - not commands invoked from the
shell, they are still parsed by the shell itself).

The only syntax change I am aware of is that #{} outside quotes or a
comment is now considered a format and not a comment, so #{ is now a
syntax error (notably, if it is at the start of a line).

This also adds two new sections to the man page documenting the syntax
and outlining how parsing and command execution works.

Thanks to everyone who sent me test configs (they still all parse
without errors - but this doesn't mean they still work as intended!).

Thanks to Avi Halachmi for testing and man page improvements, also to
jmc@ for reviewing the man page changes.

Revision 1.4 / (download) - annotate - [select for diffs], Mon May 20 11:46:06 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.3: +9 -18 lines
Diff to previous 1.3 (colored)

Replace the various identical error callbacks with a single one in cmd-queue.c.

Revision 1.3 / (download) - annotate - [select for diffs], Sun May 12 08:58:09 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.2: +12 -4 lines
Diff to previous 1.2 (colored)

Add simple menus to tree, client, buffer modes.

Revision 1.2 / (download) - annotate - [select for diffs], Sun May 12 07:27:08 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.1: +3 -19 lines
Diff to previous 1.1 (colored)

Remove menu_create_from_items, I thought I would use it for some later
work but I don't need it.

Revision 1.1 / (download) - annotate - [select for diffs], Fri May 10 18:04:06 2019 UTC (5 years ago) by nicm
Branch: MAIN

Add support for simple menus usable with mouse or keyboard. New command
display-menu shows a menu (bound to the mouse on status line by default)
and a couple of extra formats for the default menus.

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.