OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.49 / (download) - annotate - [select for diffs], Wed Aug 24 07:22:30 2022 UTC (20 months, 3 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.48: +5 -1 lines
Diff to previous 1.48 (colored)

Check for NULL returns from bufferevent_new.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Jul 6 08:31:59 2022 UTC (22 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.47: +8 -2 lines
Diff to previous 1.47 (colored)

Defer reading from control client until the command line command has
completed.

Revision 1.47 / (download) - annotate - [select for diffs], Wed Aug 25 07:09:30 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.46: +2 -2 lines
Diff to previous 1.46 (colored)

Fix up some printflike attributes.

Revision 1.46 / (download) - annotate - [select for diffs], Tue Aug 17 20:17:21 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored)

Treat a pane that has died the same as no pane when sending data to
control mode clients, GitHub issue 2828.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Sep 18 11:20:59 2020 UTC (3 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

Some other warnings, GitHub issue 2382.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Jul 6 09:14:20 2020 UTC (3 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.43: +392 -1 lines
Diff to previous 1.43 (colored)

Add a way for control mode clients to subscribe to a format and be
notified of changes rather than having to poll. GitHub issue 2242.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Jun 18 08:34:22 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.42: +2 -1 lines
Diff to previous 1.42 (colored)

Add a flag to make a client wait for an empty line before exiting in
control mode to avoid stray commands ending up in the shell.

Revision 1.42 / (download) - annotate - [select for diffs], Fri Jun 12 08:35:01 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.41: +8 -1 lines
Diff to previous 1.41 (colored)

Check if a pane needs to be paused when output is written rather than
just when it is queued.

Revision 1.41 / (download) - annotate - [select for diffs], Thu Jun 11 09:55:47 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.40: +15 -1 lines
Diff to previous 1.40 (colored)

Add a -A option to pause a pane manually.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Jun 10 07:27:10 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.39: +42 -17 lines
Diff to previous 1.39 (colored)

Instead of a buffer size limit on each pane, set a limit of 300 seconds
of data for each client in control mode.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Jun 10 06:23:43 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.38: +18 -7 lines
Diff to previous 1.38 (colored)

When the pause-after flag is set, send an alternative %extended-output
form instead of %output with the age of the output.

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 5 07:33:57 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.37: +52 -13 lines
Diff to previous 1.37 (colored)

Add support for pausing a pane when the output buffered for a control
mode client gets too far behind. The pause-after flag with a time is set
on the pane with refresh-client -f and a paused pane may be resumed with
refresh-client -A. GitHub issue 2217.

Revision 1.37 / (download) - annotate - [select for diffs], Tue Jun 2 08:17:27 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.36: +21 -5 lines
Diff to previous 1.36 (colored)

Use CLOCK_MONOTONIC for timer measurement and add a timestamp to control
mode %output blocks.

Revision 1.36 / (download) - annotate - [select for diffs], Mon Jun 1 21:08:05 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.35: +5 -3 lines
Diff to previous 1.35 (colored)

Remove blocks from queue when pane disappears.

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jun 1 09:43:01 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.34: +385 -93 lines
Diff to previous 1.34 (colored)

Instead of sending all data to control mode clients as fast as possible,
add a limit of how much data will be sent to the client and try to use
it for panes with some degree of fairness. GitHub issue 2217, with
George Nachman.

Revision 1.34 / (download) - annotate - [select for diffs], Tue May 26 08:41:47 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.33: +59 -24 lines
Diff to previous 1.33 (colored)

Pass the stdout file descriptor from the client as well as stdin and use
them for control clients directly instead of passing everything via the
client.

Revision 1.33 / (download) - annotate - [select for diffs], Sun May 24 09:40:17 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.32: +29 -16 lines
Diff to previous 1.32 (colored)

Give control code its own state struct.

Revision 1.32 / (download) - annotate - [select for diffs], Fri May 22 11:07:04 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.31: +123 -4 lines
Diff to previous 1.31 (colored)

Move client offset stuff into control.c since only control clients will
need it.

Revision 1.31 / (download) - annotate - [select for diffs], Thu May 21 07:24:13 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.30: +48 -1 lines
Diff to previous 1.30 (colored)

Support code for control mode flow control: allow clients to have
separate offsets (used and acknowleged) into the pane buffers; turn off
reading from panes when no clients can accept the data; and add a -A
flag to refresh-client to let clients turn receiving a pane on and off.

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

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

Revision 1.29 / (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.28: +5 -3 lines
Diff to previous 1.28 (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.28 / (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.27: +3 -3 lines
Diff to previous 1.27 (colored)

Move cmdq_state into cmd-queue.c.

Revision 1.27 / (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.26: +2 -2 lines
Diff to previous 1.26 (colored)

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

Revision 1.26 / (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.25: +3 -3 lines
Diff to previous 1.25 (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.25 / (download) - annotate - [select for diffs], Thu Dec 12 11:39:56 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.24: +19 -19 lines
Diff to previous 1.24 (colored)

Rewrite the code for reading and writing files. Now, if the client is
not attached, the server process asks it to open the file, similar to
how works for stdin, stdout, stderr. This makes special files like
/dev/fd/X work (used by some shells). stdin, stdout and stderr and
control mode are now just special cases of the same mechanism. This will
also make it easier to use for other commands that read files such as
source-file.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Jul 9 13:19:36 2019 UTC (4 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

Do not leak empty lines, GitHub issue 1824.

Revision 1.23 / (download) - annotate - [select for diffs], Fri May 31 11:34:09 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.22: +1 -2 lines
Diff to previous 1.22 (colored)

Allow % strings that are all numbers or %s, and fix a double free. Both
reported by George Nachman, GitHub issues 1765 and 1766.

Revision 1.22 / (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.21: +15 -9 lines
Diff to previous 1.21 (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.21 / (download) - annotate - [select for diffs], Sat May 18 21:14:10 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.20: +2 -4 lines
Diff to previous 1.20 (colored)

Move the single command flag (CMD_CONTROL) into the shared flags.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Jan 15 22:00:56 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.19: +3 -2 lines
Diff to previous 1.19 (colored)

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

Revision 1.19 / (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.18: +13 -13 lines
Diff to previous 1.18 (colored)

Mass rename struct cmd_q to struct cmdq_item and related.

Revision 1.18 / (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.17: +21 -10 lines
Diff to previous 1.17 (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.17 / (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_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

I no longer use my SourceForge address so replace it.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Nov 18 14:27:44 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Use __unused rather than rolling our own.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Nov 14 09:41:06 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Push stdout and stderr to clients more aggressively, and add an event to
continue if the send fails.

Revision 1.14 / (download) - annotate - [select for diffs], Sun Apr 19 21:34:21 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (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.13 / (download) - annotate - [select for diffs], Mon Oct 20 23:57:13 2014 UTC (9 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

Better format for printf format attributes.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Oct 10 11:45:29 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.11: +3 -3 lines
Diff to previous 1.11 (colored)

Pass flags into cmdq_guard as an argument since sometimes cmdq->cmd can
be NULL. Avoids crash when a command in a command client can't be
parsed.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jun 23 12:41:55 2013 UTC (10 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.10: +4 -1 lines
Diff to previous 1.10 (colored)

Mark control commands specially so the client can identify them, based
on a diff from George Nachman a while back.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Mar 26 10:54:48 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

Fix compiler warnings, missing #include. From Thomas Adam.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Mar 25 11:35:55 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.8: +8 -3 lines
Diff to previous 1.8 (colored)

Add time and a command count to control mode guards, based on code from
George Nachman.

Revision 1.8 / (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.7: +3 -50 lines
Diff to previous 1.7 (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.7 / (download) - annotate - [select for diffs], Fri Mar 22 15:54:29 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.6: +2 -3 lines
Diff to previous 1.6 (colored)

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

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

Remove unnecessary initializers of cmd_ctx.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Mar 22 15:49:55 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.4: +12 -10 lines
Diff to previous 1.4 (colored)

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

Revision 1.4 / (download) - annotate - [select for diffs], Mon Sep 24 13:39:10 2012 UTC (11 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.3: +10 -1 lines
Diff to previous 1.3 (colored)

Add control_write_buffer, from George Nachman.

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

Send notifications to control clients. Also don't redraw client when
suspended.

Revision 1.2 / (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.1: +4 -3 lines
Diff to previous 1.1 (colored)

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

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jun 18 13:16:42 2012 UTC (11 years, 11 months ago) by nicm
Branch: MAIN

Add a skeleton mode to tmux (called "control mode") that let's tmux
commands be sent and output received on stdout. This can be used to
integrate with other terminal emulators and should allow some other
things to be made simpler later. More to come so doesn't do much yet and
deliberately not documented.

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.