OpenBSD CVS

CVS log for src/usr.bin/tmux/key-bindings.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.148 / (download) - annotate - [select for diffs], Tue Aug 15 09:51:48 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.147: +3 -1 lines
Diff to previous 1.147 (colored)

Add meta bindings for status line menus as well as the existing pane one
for terminals which steal the mouse menu button.

Revision 1.147 / (download) - annotate - [select for diffs], Thu Feb 2 09:06:44 2023 UTC (15 months, 2 weeks ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.146: +2 -2 lines
Diff to previous 1.146 (colored)

Tweak note for D key binding, from Clark Wang.

Revision 1.146 / (download) - annotate - [select for diffs], Tue Aug 23 08:14:19 2022 UTC (20 months, 3 weeks ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.145: +2 -1 lines
Diff to previous 1.145 (colored)

Add scroll-middle copy mode command to make cursor line in the middle,
from Varun Kumar E in GitHub issue 3307.

Revision 1.145 / (download) - annotate - [select for diffs], Mon Aug 15 08:41:13 2022 UTC (21 months ago) by nicm
Branch: MAIN
Changes since 1.144: +2 -2 lines
Diff to previous 1.144 (colored)

Add some const, from Markus F X J Oberhumer.

Revision 1.144 / (download) - annotate - [select for diffs], Thu Aug 11 09:11:26 2022 UTC (21 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.143: +3 -1 lines
Diff to previous 1.143 (colored)

vi(1) Home/End bindings, from Markus F X J  Oberhumer.

Revision 1.143 / (download) - annotate - [select for diffs], Wed Jul 6 07:36:36 2022 UTC (22 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.142: +4 -1 lines
Diff to previous 1.142 (colored)

Support hyperlinks with capture-pane -e and add a mouse_hyperlink
format, GitHub issue 3247 from Jeff Chiang.

Revision 1.142 / (download) - annotate - [select for diffs], Thu Feb 3 07:26:43 2022 UTC (2 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.141: +3 -1 lines
Diff to previous 1.141 (colored)

Add a key in copy mode to toggle position indicator.

Revision 1.141 / (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_0_BASE, OPENBSD_7_0
Changes since 1.140: +41 -41 lines
Diff to previous 1.140 (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.140 / (download) - annotate - [select for diffs], Wed Aug 25 08:51:55 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.139: +4 -2 lines
Diff to previous 1.139 (colored)

Validate command argument types (string or command list) and give more
useful error messages.

Revision 1.139 / (download) - annotate - [select for diffs], Mon Aug 23 11:04:21 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.138: +5 -2 lines
Diff to previous 1.138 (colored)

Fix a few memory leaks.

Revision 1.138 / (download) - annotate - [select for diffs], Sat Aug 21 17:41:19 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.137: +253 -253 lines
Diff to previous 1.137 (colored)

Use new syntax for default key bindings.

Revision 1.137 / (download) - annotate - [select for diffs], Wed Aug 11 20:35:46 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.136: +3 -3 lines
Diff to previous 1.136 (colored)

Add pipe variants of the line copy commands. While here make the command
list less unreadable. GitHub issue 2813.

Revision 1.136 / (download) - annotate - [select for diffs], Mon Aug 9 13:08:08 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.135: +3 -3 lines
Diff to previous 1.135 (colored)

Change copy-line and copy-end-of-line not to cancel and add -and-cancel
variants, like the other copy commands. GitHub issue 2799.

Revision 1.135 / (download) - annotate - [select for diffs], Thu Jun 10 07:52:56 2021 UTC (2 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.134: +2 -2 lines
Diff to previous 1.134 (colored)

Add -F for command-prompt and use it to fix "Rename" on the window menu,
GitHub issue 2699.

Revision 1.134 / (download) - annotate - [select for diffs], Thu Jun 10 07:50:03 2021 UTC (2 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.133: +7 -7 lines
Diff to previous 1.133 (colored)

Add different command historys for different types of prompts
("command", "search" etc). From Anindya Mukherjee.

Revision 1.133 / (download) - annotate - [select for diffs], Thu Jun 10 07:21:09 2021 UTC (2 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.132: +7 -1 lines
Diff to previous 1.132 (colored)

Add another couple of keys needed for extended keys, GitHub issue 2658.

Handle modifier 9 as Meta, GitHub issue 2647.

Revision 1.132 / (download) - annotate - [select for diffs], Tue Oct 13 10:15:23 2020 UTC (3 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.131: +2 -2 lines
Diff to previous 1.131 (colored)

Fix note for "previous-window" default key binding, from Sebastian
Falbesoner.

Revision 1.131 / (download) - annotate - [select for diffs], Tue Sep 8 10:19:19 2020 UTC (3 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.130: +11 -1 lines
Diff to previous 1.130 (colored)

Allow -N without a command to change or add a note to an existing key.

Revision 1.130 / (download) - annotate - [select for diffs], Tue Jun 16 08:18:34 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.129: +50 -1 lines
Diff to previous 1.129 (colored)

d and D keys to reset to default in customize mode.

Revision 1.129 / (download) - annotate - [select for diffs], Wed Jun 3 16:35:40 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.128: +2 -2 lines
Diff to previous 1.128 (colored)

Make paste -p the default for ], GitHub issue 2248.

Revision 1.128 / (download) - annotate - [select for diffs], Wed May 20 07:11:45 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.127: +2 -2 lines
Diff to previous 1.127 (colored)

Fix a couple more places where the key flags need to be masked off.

Revision 1.127 / (download) - annotate - [select for diffs], Sat May 16 16:35:13 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.126: +3 -3 lines
Diff to previous 1.126 (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.126 / (download) - annotate - [select for diffs], Sat May 16 16:10:28 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.125: +5 -1 lines
Diff to previous 1.125 (colored)

Add a mark in copy mode. Set with set-mark command (bound to 'X') by
default and the mark and cursor position are swapped with 'jump-to-mark'
(bound to M-x). The line containing the mark is shown in
copy-mode-mark-style with the horizontal position in reverse.

From Anindya Mukherjee in GitHub issue 2209.

Revision 1.125 / (download) - annotate - [select for diffs], Sat May 16 16:02:24 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.124: +53 -9 lines
Diff to previous 1.124 (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.124 / (download) - annotate - [select for diffs], Sat May 16 15:16:36 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.123: +3 -3 lines
Diff to previous 1.123 (colored)

Add -W and -T flags to command-prompt to only complete a window and a
target, also complete aliases.

Revision 1.123 / (download) - annotate - [select for diffs], Fri Apr 17 08:03:22 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.122: +13 -13 lines
Diff to previous 1.122 (colored)

Add a copy-command option and change copy-pipe and friends to pipe to it
if used without arguments, allows all copy key bindings to be changed to
pipe with one option.

Revision 1.122 / (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.121: +6 -3 lines
Diff to previous 1.121 (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.121 / (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.120: +5 -5 lines
Diff to previous 1.120 (colored)

Move cmdq_state into cmd-queue.c.

Revision 1.120 / (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.119: +2 -2 lines
Diff to previous 1.119 (colored)

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

Revision 1.119 / (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.118: +2 -2 lines
Diff to previous 1.118 (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.118 / (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.117: +3 -9 lines
Diff to previous 1.117 (colored)

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

Revision 1.117 / (download) - annotate - [select for diffs], Mon Apr 6 17:51:34 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.116: +3 -1 lines
Diff to previous 1.116 (colored)

Change copy mode to make copy of the pane history so it does not need to
freeze updates (which does not play nicely with some applications, a
longstanding problem) and will allow some other changes later. From
Anindya Mukherjee.

Revision 1.116 / (download) - annotate - [select for diffs], Thu Apr 2 05:35:15 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.115: +4 -4 lines
Diff to previous 1.115 (colored)

Add a W position to display-menu -y to use the line above (or below) the
status line containing the window list. Leave S meaning above (or below)
all status lines. GitHub issue 2145.

Revision 1.115 / (download) - annotate - [select for diffs], Fri Mar 20 18:35:53 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.114: +4 -4 lines
Diff to previous 1.114 (colored)

Apply same menu items to view mode like copy mode.

Revision 1.114 / (download) - annotate - [select for diffs], Fri Mar 20 18:22:37 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.113: +2 -2 lines
Diff to previous 1.113 (colored)

Similarly, disable zoom if only one pane.

Revision 1.113 / (download) - annotate - [select for diffs], Fri Mar 20 18:20:58 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.112: +2 -2 lines
Diff to previous 1.112 (colored)

Put swap down back in the right place.

Revision 1.112 / (download) - annotate - [select for diffs], Fri Mar 20 18:19:22 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.111: +5 -5 lines
Diff to previous 1.111 (colored)

Disable swap entries if nothing to swap with.

Revision 1.111 / (download) - annotate - [select for diffs], Fri Mar 20 18:11:56 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.110: +2 -2 lines
Diff to previous 1.110 (colored)

Still want the per-mode menus outside copy mode.

Revision 1.110 / (download) - annotate - [select for diffs], Fri Mar 20 18:05:22 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.109: +2 -2 lines
Diff to previous 1.109 (colored)

Oops, typo in key binding.

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

Make the mouse_word and mouse_line formats work in copy mode and enable
the default pane menu in copy mode.

Revision 1.108 / (download) - annotate - [select for diffs], Thu Mar 12 13:48:32 2020 UTC (4 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.107: +46 -14 lines
Diff to previous 1.107 (colored)

Tidy up the default mouse key bindings and:

- Add double and triple click bindings to copy a word or line outside
  copy mode. The text is selected for a short period to show what has
  been copied. This is in line with the existing mouse selection where
  the text is copied and the selection is cleared when the mouse button
  is released.

- Change the existing double and triple click bindings in copy mode to
  behave in the same way.

- Add a button 2 binding to paste the top buffer.

Revision 1.107 / (download) - annotate - [select for diffs], Mon Jan 27 08:53:13 2020 UTC (4 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.106: +86 -82 lines
Diff to previous 1.106 (colored)

Add support for adding a note to a key binding (with bind-key -N) and
use this to add descriptions to the default key bindings. A new -N flag
to list-keys shows key bindings with notes rather than the default
bind-key command used to create them. Change the default ? binding to
use this to show a readable summary of keys.

Also extend command-prompt to return the name of the key pressed and add
a default binding (/) to show the note for the next key pressed

Suggested by Alex Tremblay in GitHub issue 2000.

Revision 1.106 / (download) - annotate - [select for diffs], Sun Jan 5 20:39:25 2020 UTC (4 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.105: +18 -21 lines
Diff to previous 1.105 (colored)

Common function to free key bindings.

Revision 1.105 / (download) - annotate - [select for diffs], Thu Dec 19 09:22:33 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored)

When adding a list with multiple commands to the queue, the next item to
insert after needs to be the last one added, not the first. Reported by
Jason Kim in GitHub issue 2023.

Revision 1.104 / (download) - annotate - [select for diffs], Mon Dec 2 19:25:52 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.103: +1 -8 lines
Diff to previous 1.103 (colored)

Remove client menu, I don't think it adds anything.

Revision 1.103 / (download) - annotate - [select for diffs], Tue Nov 26 15:35:56 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.102: +3 -1 lines
Diff to previous 1.102 (colored)

Add default # and * binding with vi(1) keys.

Revision 1.102 / (download) - annotate - [select for diffs], Wed Nov 20 11:42:51 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.101: +10 -6 lines
Diff to previous 1.101 (colored)

Do not check the client readonly flag when there is no client, GitHub issue 1980.

Revision 1.101 / (download) - annotate - [select for diffs], Wed Sep 18 15:09:05 2019 UTC (4 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.100: +3 -3 lines
Diff to previous 1.100 (colored)

Up and Down are already used, use < and > instead.

Revision 1.100 / (download) - annotate - [select for diffs], Mon Sep 16 13:27:14 2019 UTC (4 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.99: +3 -3 lines
Diff to previous 1.99 (colored)

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

Revision 1.99 / (download) - annotate - [select for diffs], Tue Sep 10 07:50:33 2019 UTC (4 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.98: +1 -2 lines
Diff to previous 1.98 (colored)

Set up format tree for %if, GitHub issue 1896.

Revision 1.98 / (download) - annotate - [select for diffs], Tue May 28 10:27:11 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (colored)

Change the default right click pane to open the menu if not in a mode
and no application mouse.

Revision 1.97 / (download) - annotate - [select for diffs], Tue May 28 10:05:24 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.96: +53 -45 lines
Diff to previous 1.96 (colored)

Add key bindings to open the window and pane menus (C-m and M-m for now).

Revision 1.96 / (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.95: +3 -3 lines
Diff to previous 1.95 (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.95 / (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.94: +46 -5 lines
Diff to previous 1.94 (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.94 / (download) - annotate - [select for diffs], Mon May 27 12:16:27 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.93: +7 -7 lines
Diff to previous 1.93 (colored)

Add an additional {} syntax for defining strings in the configuration
file, making it much tidier to define commands that contain other tmux
or shell commands (like if-shell). Also tweak bind-key to expect a
string if it is only given one argument, so {} can be used with it as
well. From Avi Halachmi.

Revision 1.93 / (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.92: +7 -8 lines
Diff to previous 1.92 (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.92 / (download) - annotate - [select for diffs], Sun May 12 08:58:09 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.91: +3 -3 lines
Diff to previous 1.91 (colored)

Add simple menus to tree, client, buffer modes.

Revision 1.91 / (download) - annotate - [select for diffs], Fri May 10 18:04:06 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.90: +6 -1 lines
Diff to previous 1.90 (colored)

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.

Revision 1.90 / (download) - annotate - [select for diffs], Thu May 9 13:12:59 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.89: +3 -2 lines
Diff to previous 1.89 (colored)

send-keys also needs to insert key commands in the right order.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Apr 29 06:55:21 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.88: +4 -1 lines
Diff to previous 1.88 (colored)

Add support for keys to jump between matching brackets - C-M-f and C-M-b
in emacs, % in vi. Suggested by and help from Chris Barber in GitHub
issue 1666.

Revision 1.88 / (download) - annotate - [select for diffs], Thu Oct 18 08:38:01 2018 UTC (5 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.87: +6 -1 lines
Diff to previous 1.87 (colored)

Support for windows larger than visible on the attached client. This has
been a limitation for a long time.

There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.

The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.

If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.

Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).

The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.

For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..

If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.

The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.

The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.

Revision 1.87 / (download) - annotate - [select for diffs], Mon Aug 20 15:00:42 2018 UTC (5 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.86: +2 -2 lines
Diff to previous 1.86 (colored)

Add -Z to find-window as well.

Revision 1.86 / (download) - annotate - [select for diffs], Thu Aug 2 11:44:07 2018 UTC (5 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.85: +43 -8 lines
Diff to previous 1.85 (colored)

Make key trees and some other bits static.

Revision 1.85 / (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_3_BASE, OPENBSD_6_3
Changes since 1.84: +5 -5 lines
Diff to previous 1.84 (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.84 / (download) - annotate - [select for diffs], Wed Nov 15 19:59:27 2017 UTC (6 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.83: +2 -1 lines
Diff to previous 1.83 (colored)

Add a common function for spreading out cells and use it for the two
even layouts and to add a -E flag to select-layout to spread out cells
evenly without changing parent cells.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Oct 5 13:43:34 2017 UTC (6 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.82: +4 -4 lines
Diff to previous 1.82 (colored)

Add -- to some key bindings so leading -s work.

Revision 1.82 / (download) - annotate - [select for diffs], Fri Sep 8 08:45:27 2017 UTC (6 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.81: +6 -1 lines
Diff to previous 1.81 (colored)

When removing a key table clear it out of clients, fixes issue with
unbind -a reported by Thomas Sattler.

Revision 1.81 / (download) - annotate - [select for diffs], Fri Jun 9 14:00:46 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.80: +33 -33 lines
Diff to previous 1.80 (colored)

Use brackets around prompts which looks better and matches the other modes.

Revision 1.80 / (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.79: +3 -3 lines
Diff to previous 1.79 (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.79 / (download) - annotate - [select for diffs], Tue May 30 08:13:48 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.78: +3 -3 lines
Diff to previous 1.78 (colored)

Preserve search string when entering prompt again.

Revision 1.78 / (download) - annotate - [select for diffs], Wed May 10 10:46:59 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.77: +11 -8 lines
Diff to previous 1.77 (colored)

Insert copy mode bindings at the right place in the command queue.

Revision 1.77 / (download) - annotate - [select for diffs], Sun May 7 21:25:59 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.76: +3 -3 lines
Diff to previous 1.76 (colored)

Up to now, tmux sees \033\033[OA as M-Up and since we turned on
xterm-keys by default, generates \033[1;3A instead of
\033\033[OA. Unfortunately this confuses vi, which doesn't understand
xterm keys and now sees Escape+Up pressed within escape-time as Escape
followed by A.

The issue doesn't happen in xterm itself because it gets the keys from X
and can distinguish between a genuine M-Up and Escape+Up.

Because xterm can, tmux can too: xterm will give us \033[1;3A (that is,
kUP3) for a real M-Up and \033\033OA for Escape+Up - in fact, we can be
sure any \033 preceding an xterm key is a real Escape key press because
Meta would be part of the xterm key instead of a separate \033.

So change tmux to recognise both sequences as M-Up for its own purposes,
but generate the xterm version of M-Up only if it originally received
the xterm version from the terminal.

This means we will return to sending \033\033OA instead of the xterm key
for terminals that do not support xterm keys themselves, but there is no
practical way around this because they do not allow us to distinguish
between Escape+Up and M-Up. xterm style escape sequences are now the de
facto standard for these keys in any case.

Problem reported by jsing@ and subsequently by Cecile Tonglet in GitHub
issue 907.

Revision 1.76 / (download) - annotate - [select for diffs], Fri Apr 21 19:33:07 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.75: +2 -2 lines
Diff to previous 1.75 (colored)

Key needs to be initialized to zero now it has flags in it.

Revision 1.75 / (download) - annotate - [select for diffs], Fri Apr 21 14:01:19 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.74: +6 -4 lines
Diff to previous 1.74 (colored)

Store state shared between multiple commands in the queue in a shared
structure.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Apr 5 12:14:18 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.73: +3 -1 lines
Diff to previous 1.73 (colored)

Add Home and End for copy mode.

Revision 1.73 / (download) - annotate - [select for diffs], Mon Feb 6 15:00:41 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.72: +9 -5 lines
Diff to previous 1.72 (colored)

Cancel key table when switching session, unless the key is going to
repeat. Reported by Amos Bird.

Revision 1.72 / (download) - annotate - [select for diffs], Tue Jan 24 19:53:37 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

Add support for custom command aliases, this is an array option which
contains items of the form "alias=command". This is consulted when an
unknown command is parsed.

Revision 1.71 / (download) - annotate - [select for diffs], Mon Jan 16 14:52:25 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.70: +1 -1 lines
Diff to previous 1.70 (colored)

Revert WIP parts of previous I didn't mean to commit yet.

Revision 1.70 / (download) - annotate - [select for diffs], Mon Jan 16 14:49:14 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.69: +2 -2 lines
Diff to previous 1.69 (colored)

getopt() has a struct option so just return to using options_entry.

Revision 1.69 / (download) - annotate - [select for diffs], Sun Jan 15 22:00:56 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.68: +3 -5 lines
Diff to previous 1.68 (colored)

It is silly for cmd_list_parse to return an integer error when it could
just return NULL.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Jan 6 11:57:03 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.67: +33 -33 lines
Diff to previous 1.67 (colored)

Incremental search in copy mode (on for emacs keys by default) - much
the same as normal searching but updates the cursor position and marked
search terms as you type. C-r and C-s in the prompt repeat the search,
once finished searching (with Enter), N and n work as before.

Revision 1.67 / (download) - annotate - [select for diffs], Wed Dec 7 09:16:13 2016 UTC (7 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.66: +3 -1 lines
Diff to previous 1.66 (colored)

Make prefix work in all tables (except the prefix table). Users who want
to avoid this can set prefix to "none" and bind send-prefix
themselves. Allows C-b t be bound in the copy mode tables again, pointed
out by millert@.

Revision 1.66 / (download) - annotate - [select for diffs], Thu Nov 24 13:46:50 2016 UTC (7 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.65: +13 -11 lines
Diff to previous 1.65 (colored)

Fix so that we work out the right pane from mouse events - we were doing
so too early, before the mouse event was necessarily valid, so could end
up using the pane from the previous mouse event, or the active pane.

It is important that we use the right pane now that different panes can
have different key tables (for copy mode).

Fixes problem reported by Greg Hurrell.

Revision 1.65 / (download) - annotate - [select for diffs], Wed Nov 23 17:01:24 2016 UTC (7 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

For mouse keys, use the mouse pane as the default current pane.

Revision 1.64 / (download) - annotate - [select for diffs], Fri Oct 21 13:51:59 2016 UTC (7 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.63: +13 -13 lines
Diff to previous 1.63 (colored)

Add %%% to substitute with quotes escaped (convert " to \"). Use this
for the prompts in copy mode. Fixes problems with jumping to ' reported
by Theo Buehler.

Revision 1.63 / (download) - annotate - [select for diffs], Wed Oct 19 09:24:57 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.62: +1 -2 lines
Diff to previous 1.62 (colored)

Do not have a default binding for C-b in copy-mode-vi or it conflicts
with the default prefix. Reported by natano@.

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

Mass rename struct cmd_q to struct cmdq_item and related.

Revision 1.61 / (download) - annotate - [select for diffs], Sun Oct 16 17:55:14 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.60: +13 -11 lines
Diff to previous 1.60 (colored)

Rewrite command queue handling. Each client still has a command queue,
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.

Revision 1.60 / (download) - annotate - [select for diffs], Wed Oct 12 13:03:27 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.59: +20 -20 lines
Diff to previous 1.59 (colored)

The repeat prompt in both emacs and vi (and the old one in tmux) doesn't
support line editing and instead executes a command as soon as a
non-number key is pressed. Add a -N flag to command-prompt for the same
in copy mode. Reported by Theo Buehler.

Revision 1.59 / (download) - annotate - [select for diffs], Tue Oct 11 09:30:36 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.58: +5 -1 lines
Diff to previous 1.58 (colored)

Support double and triple clicks (they are cumulative, so double is
fired then triple), and use for select-word and select-line in copy
mode. Inspired by a different solution from Omar Sandoval.

Revision 1.58 / (download) - annotate - [select for diffs], Tue Oct 11 07:23:34 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.57: +137 -1 lines
Diff to previous 1.57 (colored)

Fundamental change to how copy mode key bindings work:

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.

Revision 1.57 / (download) - annotate - [select for diffs], Tue Mar 1 12:06:07 2016 UTC (8 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.56: +3 -3 lines
Diff to previous 1.56 (colored)

Remove some more unused variables, and use RB_FOREACH_SAFE in
key_bindings_unref_table.

Revision 1.56 / (download) - annotate - [select for diffs], Tue Jan 19 15:59:12 2016 UTC (8 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

I no longer use my SourceForge address so replace it.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Nov 12 11:05:34 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.54: +8 -4 lines
Diff to previous 1.54 (colored)

Support UTF-8 key bindings by expanding the key type from int to
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.)

Revision 1.54 / (download) - annotate - [select for diffs], Thu Nov 5 11:05:30 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

Pass through right click if mouse is on, from Patrick Palka.

Revision 1.53 / (download) - annotate - [select for diffs], Tue Oct 27 09:15:21 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

Use copy-mode -et= in WheelUpPane binding, from Patrick Palka.

Revision 1.52 / (download) - annotate - [select for diffs], Mon Oct 26 23:06:18 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.51: +3 -1 lines
Diff to previous 1.51 (colored)

Default bindings for mouse wheel on status line to change window (like
we had before), from Patrick Palka.

Revision 1.51 / (download) - annotate - [select for diffs], Wed Oct 21 11:13:47 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.50: +2 -1 lines
Diff to previous 1.50 (colored)

By popular demand add a default binding for mouse wheel up to scroll
into history (if the mouse is, on of course).

Revision 1.50 / (download) - annotate - [select for diffs], Fri Jun 5 08:14:16 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.49: +11 -11 lines
Diff to previous 1.49 (colored)

Make it so that if a window or session target is prefixed with an =,
only an exact name or index match is accepted, no special character,
prefix match, or fnmatch.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Jun 4 11:43:51 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.48: +4 -1 lines
Diff to previous 1.48 (colored)

Add support for a single "marked pane". There is one marked pane in the
server at a time; it may be toggled or cleared with select-pane -m and
-M (the border is highlighted). A new target '~' or '{marked}' specifies
the marked pane to commands and it is the default target for the
swap-pane and join-pane -s flag (this makes them much simpler to use -
mark the source pane and then change to the target pane to run swapp or
joinp).

Revision 1.48 / (download) - annotate - [select for diffs], Thu May 7 11:42:56 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

Style spacing nits.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Apr 25 18:49:01 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

Fix some char* -> char *.

Revision 1.46 / (download) - annotate - [select for diffs], Tue Apr 21 15:34:32 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

Bind mouse dragging so that it is passed through to applications if they
want it rather than entering copy mode.

Revision 1.45 / (download) - annotate - [select for diffs], Mon Apr 20 15:34:56 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.44: +85 -27 lines
Diff to previous 1.44 (colored)

Support for multiple key tables to commands to be bound to sequences of
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.

Revision 1.44 / (download) - annotate - [select for diffs], Sun Apr 19 21:34:21 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.43: +10 -5 lines
Diff to previous 1.43 (colored)

Rewrite of tmux mouse support which was a mess. Instead of having
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.

Revision 1.43 / (download) - annotate - [select for diffs], Wed Oct 22 23:18:53 2014 UTC (9 years, 6 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.42: +5 -5 lines
Diff to previous 1.42 (colored)

Fix some spacing nits.

Revision 1.42 / (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.41: +87 -95 lines
Diff to previous 1.41 (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.41 / (download) - annotate - [select for diffs], Wed May 14 06:21:19 2014 UTC (10 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.40: +3 -16 lines
Diff to previous 1.40 (colored)

Now that cmdlists are reference counted, there is no need for two-step
deletion via the dead_key_bindings tree. From Keith Amling.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Apr 17 07:55:43 2014 UTC (10 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

Remove the "info" message mechanism, this was only used for about five
mostly useless and annoying messages. Change those commands to silence
on success like all the others. Still accept the -q command line flag
and "quiet" server option for now.

Revision 1.39 / (download) - annotate - [select for diffs], Sun Mar 24 09:57:59 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored)

Add resize-pane -Z to temporary zoom the active pane to occupy the full
window or unzoom (restored to the normal layout) if it already zoomed,
bound to C-b z by default. The pane is unzoomed on pretty much any
excuse whatsoever.

We considered making this a new layout but the requirements are quite
different from layouts so decided it is better as a special case. Each
current layout cell is saved, a temporary one-cell layout generated and
all except the active pane set to NULL.

Prompted by suggestions and scripts from several. Thanks to Aaron Jensen
and Thiago Padilha for testing an earlier version.

Revision 1.38 / (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.37: +7 -74 lines
Diff to previous 1.37 (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.37 / (download) - annotate - [select for diffs], Fri Mar 22 15:54:29 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.36: +2 -3 lines
Diff to previous 1.36 (colored)

Need to set clients in context before changing their reference count.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Mar 22 15:50:42 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.35: +1 -4 lines
Diff to previous 1.35 (colored)

Remove unnecessary initializers of cmd_ctx.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Mar 22 15:49:55 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.34: +13 -12 lines
Diff to previous 1.34 (colored)

Add functions to allocate and free command contexts rather than doing it
all on the stack.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jan 17 00:11:22 2013 UTC (11 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.33: +1 -3 lines
Diff to previous 1.33 (colored)

Remove the layout undo/redo code which never really worked.

Revision 1.33 / (download) - annotate - [select for diffs], Tue Jul 10 11:53:01 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.32: +4 -4 lines
Diff to previous 1.32 (colored)

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

Revision 1.32 / (download) - annotate - [select for diffs], Sun Jul 8 16:04:38 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

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.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Jun 18 09:58:02 2012 UTC (11 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.30: +12 -2 lines
Diff to previous 1.30 (colored)

Add a couple of NULL pointer checks to key binding functions, from
jspenguin on SF bug 3535531.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Apr 1 13:18:38 2012 UTC (12 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.29: +3 -1 lines
Diff to previous 1.29 (colored)

Add a layout history which can be stepped through with select-layout -u
and -U commands (bound to 'u' and 'U' by default).

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jan 21 11:12:13 2012 UTC (12 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.28: +10 -10 lines
Diff to previous 1.28 (colored)

Use RB trees not SPLAY.

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jul 3 18:18:15 2011 UTC (12 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

Include the existing window and session name in the prompt when renaming
and add a new key binding ($) for rename session. From Tiago Cunha.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jan 4 00:42:47 2011 UTC (13 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.26: +5 -4 lines
Diff to previous 1.26 (colored)

Clean up and simplify tmux command argument parsing.

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.

Revision 1.26 / (download) - annotate - [select for diffs], Sat Dec 11 18:39:25 2010 UTC (13 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored)

Track the last session for a client and add a flag to switch-client and
a key binding (L) to move a client back to its last session.

Revision 1.25 / (download) - annotate - [select for diffs], Sat Oct 23 13:04:34 2010 UTC (13 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored)

Add a last-pane command (bound to ; by default). Requested ages ago by
somebody whose name I have forgotten.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Sep 8 22:02:28 2010 UTC (13 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.23: +3 -1 lines
Diff to previous 1.23 (colored)

Add -n and -p flags to switch-client to move to the next and previous
session (yes, it doesn't match window/pane, but so what, nor does
switch-client).

Based on a diff long ago from "edsouza".

Revision 1.23 / (download) - annotate - [select for diffs], Sat Jun 26 18:20:53 2010 UTC (13 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.22: +5 -4 lines
Diff to previous 1.22 (colored)

Setting the cmdlist pointer in the bind-key to NULL to prevent it being freed
after the command is executing is bogus because it may still be needed if the
same command is going to be executed again (for example if you "bind-key a
bind-key b ..."). Making a copy is hard, so instead add a reference count to
the cmd_list.

While here, also print bind-key -n and the rest of the flags properly.

Fixes problem reported by mcbride@.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jun 21 21:44:09 2010 UTC (13 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.21: +2 -1 lines
Diff to previous 1.21 (colored)

Add a choose-buffer command for easier use of the paste buffer stack.

Revision 1.21 / (download) - annotate - [select for diffs], Wed May 5 23:24:23 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Identical behaviour to select-prompt can now be obtained with
command-prompt, so remove select-prompt and change ' to be bound to
command-prompt -p index "select-window -t :%%".

Revision 1.20 / (download) - annotate - [select for diffs], Sun Apr 25 20:28:13 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored)

Add a tiled layout, originally from Liam Bedford a while ago, fixed up
by me.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Apr 6 21:35:44 2010 UTC (14 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.18: +6 -4 lines
Diff to previous 1.18 (colored)

Merge copy mode and output mode, dropping the latter. Idea and code from
Micah Cowan.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Mar 22 19:07:52 2010 UTC (14 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.17: +6 -4 lines
Diff to previous 1.17 (colored)

Support up, down, left, right movement through panes with -UDLR flags to
select-pane.

Also REMOVE the up- and down-pane commands: equivalent behaviour is now
available using -t :.+ and -t :.-.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Feb 6 22:55:31 2010 UTC (14 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.16: +14 -2 lines
Diff to previous 1.16 (colored)

Support attaching a client read-only with a new -r flag to the attach-session
command.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Dec 10 09:16:52 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Add "server options" which are server-wide and not bound to a session or
window. Set and displayed with "set -s" and "show -s".

Currently the only option is "quiet" (like command-line -q, allowing it to be
set from .tmux.conf), but others will come along.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Dec 3 22:50:10 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.14: +8 -8 lines
Diff to previous 1.14 (colored)

Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last
time now I've configured emacs to make them displayed in really annoying
colours...

Revision 1.14 / (download) - annotate - [select for diffs], Wed Nov 18 13:16:33 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.13: +7 -6 lines
Diff to previous 1.13 (colored)

Add a per-client log of status line messages displayed while that client
exists. A new message-limit session option sets the maximum number of entries
and a command, show-messages, shows the log (bound to ~ by default).

This (and prompt history) might be better as a single global log but until
there are global options it is easier for them to be per client.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Nov 13 07:00:54 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.12: +1 -15 lines
Diff to previous 1.12 (colored)

Zap unused functions, prompted by deraadt.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Oct 6 07:19:32 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.11: +2 -3 lines
Diff to previous 1.11 (colored)

Remove scroll mode which is now redundant, copy mode should be used instead.

The = key binding now does nothing.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Aug 31 20:46:19 2009 UTC (14 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (colored)

Add a new display-panes command, with two options (display-panes-colour and
display-panes-time), which displays a visual indication of the number of each
pane.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Aug 25 12:18:51 2009 UTC (14 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.9: +4 -3 lines
Diff to previous 1.9 (colored)

Add a choose-client command and extend choose-{session,window} to accept a
template. After a choice is made, %% (or %1) in the template is replaced by the
name of the session, window or client suitable for -t and the result executed
as a command. So, for example, "choose-window "killw -t '%%'"" will kill the
selected window.

The defaults if no template is given are (as now) select-window for
choose-window, switch-client for choose-session, and detach-client for
choose-client (now bound to D).

Revision 1.9 / (download) - annotate - [select for diffs], Sun Aug 23 16:45:00 2009 UTC (14 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.8: +2 -3 lines
Diff to previous 1.8 (colored)

The cursession member in struct cmd_ctx is always either curclient->session or
NULL when curclient is also NULL, so just eliminate it.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Jul 24 14:52:47 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.7: +15 -3 lines
Diff to previous 1.7 (colored)

Permit commands to be bound to key presses without the prefix key first. The
new -n flag to bind-key and unbind-key sets or removes these bindings, and
list-key shows them in []s.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Jul 21 17:57:29 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.6: +16 -16 lines
Diff to previous 1.6 (colored)

Tidy up keys: use an enum for the key codes, and remove the macros which just
wrap flag sets/clears/tests.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jul 19 13:21:40 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.5: +10 -5 lines
Diff to previous 1.5 (colored)

Improved layout code.

Each window now has a tree of layout cells associated with it. In this tree,
each node is either a horizontal or vertical cell containing a list of other
cells running from left-to-right or top-to-bottom, or a leaf cell which is
associated with a pane.

The major functional changes are:

- panes may now be split arbitrarily both horizontally (splitw -h, C-b %) and
  vertically (splitw -v, C-b ");
- panes may be resized both horizontally and vertically (resizep -L/-R/-U/-D,
  bound to C-b left/right/up/down and C-b M-left/right/up/down);
- layouts are now applied and then may be modified by resizing or splitting
  panes, rather than being fixed and reapplied when the window is resized or
  panes are added;
- manual-vertical layout is no longer necessary, and active-only layout is gone
  (but may return in future);
- the main-pane layouts now reduce the size of the main pane to fit all panes
  if possible.

Thanks to all who tested.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jul 17 18:45:08 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

- New command display-message (alias display) to display a message in the
  status line (bound to "i" and displays the current window and time by
  default). The same substitutions are applied as for status-left/right.
- Add support for including the window index (#I), pane index (#P) and window
  name (#W) in the message, and status-left or status-right.
- Bump protocol version.

From Tiago Cunha, thanks!

Revision 1.4 / (download) - annotate - [select for diffs], Fri Jul 17 13:43:07 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.3: +3 -4 lines
Diff to previous 1.3 (colored)

Remove a duplicate key binding, and turn off autorepeat for up/down as it is
kind of annoying by default.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jul 15 17:39:00 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

Make status_message_set a variadic printf-like function. No functional change -
helpful for a couple of things coming soon.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jul 12 17:33:18 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.1: +22 -9 lines
Diff to previous 1.1 (colored)

Creating a key binding which replaces itself (such as "bind x bind x lsw")
frees the command list bound to the key while it is still being executed,
leading to a use after free. To prevent this, create a dead keys list and defer
freeing replaced or removed key bindings until the main loop when the key
binding will have finished executing.

Found by Johan Friis when creating a key binding to reload his configuration
file.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jun 1 22:58:49 2009 UTC (14 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6

Import tmux, a terminal multiplexor allowing (among other things) a single
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

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.