OpenBSD CVS

CVS log for src/usr.bin/tmux/Attic/cmd-list.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.21, Sat May 25 07:29:04 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.20: +1 -1 lines
FILE REMOVED

Merge the now tiny cmd-list.c into cmd.c.

Revision 1.20 / (download) - annotate - [select for diffs], Sat May 25 07:18:20 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.19: +1 -57 lines
Diff to previous 1.19 (colored)

Merge cmd_list_parse into cmd-parse.y so it can use the new alias
processing code.

Revision 1.19 / (download) - annotate - [select for diffs], Thu May 23 14:03:44 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.18: +9 -5 lines
Diff to previous 1.18 (colored)

Break the argument escaping code into a separate function and use it to
escape key bindings in list-keys. Also escape ~ and ; and $ properly.

Revision 1.18 / (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.17: +25 -5 lines
Diff to previous 1.17 (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.17 / (download) - annotate - [select for diffs], Mon May 20 11:34:37 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.16: +13 -4 lines
Diff to previous 1.16 (colored)

Add a helper to allocate a cmd_list.

Revision 1.16 / (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_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, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

I no longer use my SourceForge address so replace it.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Nov 27 15:06:43 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.14: +20 -17 lines
Diff to previous 1.14 (colored)

Do not set a limit on the length of commands when printing them.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Sep 1 21:50:18 2014 UTC (9 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

Various minor style and spacing nits.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Apr 11 19:35:54 2014 UTC (10 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.12: +8 -4 lines
Diff to previous 1.12 (colored)

Don't blindly increase offsets by the return value of snprintf, if there
wasn't enough space this will go off the end. Instead clamp to the
available space. Fixes crash reported by Julien Rebetez.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Mar 24 09:54:10 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.11: +11 -64 lines
Diff to previous 1.11 (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.11 / (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.10: +4 -3 lines
Diff to previous 1.10 (colored)

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

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jul 13 06:27:41 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.9: +5 -1 lines
Diff to previous 1.9 (colored)

Add a queue of notifys and a way to turn them off and on (we do not want
notifys to happen during some commands). Based on code from George
Nachman.

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

Make command exec functions return an enum rather than -1/0/1 values and
add a new value to mean "leave client running but don't attach" to fix
problems with using some commands in a command sequence. Most of the
work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.

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

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

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jun 18 13:16:42 2012 UTC (11 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.6: +15 -3 lines
Diff to previous 1.6 (colored)

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.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Oct 29 20:11:57 2010 UTC (13 years, 6 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.5: +13 -9 lines
Diff to previous 1.5 (colored)

We now send argv to the server after parsing it in the client to get the
command, so the client should not modify it. Instead, take a copy. Fixes
parsing command lists, reported by mcbride@.

Revision 1.5 / (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.4: +13 -9 lines
Diff to previous 1.4 (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.4 / (download) - annotate - [select for diffs], Mon Mar 22 19:14:55 2010 UTC (14 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.3: +5 -1 lines
Diff to previous 1.3 (colored)

Reset output functions too when changing client after attaching, to
avoid crash if a command in a sequence after new/attach causes output.

Revision 1.3 / (download) - annotate - [select for diffs], Sat Jan 30 19:08:47 2010 UTC (14 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.2: +24 -5 lines
Diff to previous 1.2 (colored)

Don't stop parsing command sequences when a command requests the client to
stick around (attach-session/new-session).

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jul 26 12:58:44 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.1: +1 -36 lines
Diff to previous 1.1 (colored)

Make all messages sent between the client and server fixed size.

This is the first of two changes to make the protocol more resilient and less
sensitive to other changes in the code, particularly with commands. The client
now packs argv into a buffer and sends it to the server for parsing, rather
than doing it itself and sending the parsed command data.

As a side-effect this also removes a lot of now-unused command marshalling
code.

Mixing a server without this change and a client with or vice versa will cause
tmux to hang or crash, please ensure that tmux is entirely killed before
upgrading.

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.