Commit Graph

425 Commits

Author SHA1 Message Date
Thomas Adam
31a6e5eff4 Merge branch 'obsd-master' into master 2021-09-10 02:01:12 +01:00
nicm
768fb9080f Keep -? as usage. 2021-09-09 21:55:03 +00:00
Thomas Adam
609baea95e Merge branch 'obsd-master' into master 2021-08-27 20:01:11 +01:00
nicm
daec63e5e6 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.
2021-08-27 17:25:55 +00:00
Thomas Adam
c6375a0d40 Merge branch 'obsd-master' into master 2021-08-25 12:01:11 +01:00
nicm
03d173cbd8 Validate command argument types (string or command list) and give more
useful error messages.
2021-08-25 08:51:55 +00:00
Thomas Adam
324f87cf14 Merge branch 'obsd-master' into master 2021-08-22 12:08:05 +01:00
nicm
326d2ef234 Pass typed arguments out of the parser into the arguments list and let
it convert them into strings.
2021-08-21 18:39:07 +00:00
Thomas Adam
4d3367e965 Merge branch 'obsd-master' into master 2021-08-21 16:01:26 +01:00
nicm
68cacaec68 Remove some members of struct cmd which are no longer used. 2021-08-21 14:10:08 +00:00
nicm
c286fbdcd7 Preserve command group when moving temporary list to current list being
buit.
2021-08-21 14:06:17 +00:00
Thomas Adam
62036121fa Merge branch 'obsd-master' into master 2021-08-21 12:01:41 +01:00
nicm
d371764d02 Wrap command argument definitions in their own struct. 2021-08-21 08:44:59 +00:00
Thomas Adam
b0da0cee4d Merge branch 'obsd-master' into master 2021-08-20 22:01:46 +01:00
nicm
5f32b7d961 Hide struct args behind a couple of accessor functions. 2021-08-20 19:50:16 +00:00
nicm
de94a344f6 Add a couple of const and fix some warnings. 2021-08-20 19:34:51 +00:00
nicm
866117636e Add different command historys for different types of prompts
("command", "search" etc). From Anindya Mukherjee.
2021-06-10 07:50:03 +00:00
Nicholas Marriott
c03b57465b Add different command historys for different types of prompts ("command",
"search" etc). From Anindya Mukherjee.
2021-05-03 07:39:32 +01:00
Thomas Adam
a284664e71 Merge branch 'obsd-master' 2020-06-29 18:01:18 +01:00
bket
2a9bdb700d Replace TAILQ concatenation loop with TAILQ_CONCAT
As a result remove unneeded variables

OK @nicm
2020-06-29 15:53:28 +00:00
Thomas Adam
b0a6025897 Merge branch 'obsd-master' 2020-06-04 10:01:20 +01:00
nicm
b3782d2dc8 Instead of using a custom parse function to process {}, treat it as a
set of statements and parse with yacc, then convert back to a string as
the last step. This means the rules are consistent inside and outside
{}, %if and friends work at the right time, and the final result isn't
littered with unnecessary newlines.
2020-06-04 07:12:05 +00:00
nicm
d67245c734 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.
2020-05-16 16:02:24 +00:00
Nicholas Marriott
a61cbf1c33 Add a customize mode where options may be browsed and changed, includes adding
a brief description of each option. Bound to "C" by default.
2020-05-08 19:10:09 +01:00
Thomas Adam
acc00cd13a Merge branch 'obsd-master' 2020-04-13 18:01:43 +01:00
nicm
34804f2709 When parsing strings, put all commands in one group even if there are
newlines. This means that for example bind q { a \n b } and bind q "a ;
b" are the same. Also log commands in different groups separated by ;;
rather than ; (a command list like this should never be user visible).
2020-04-13 16:19:37 +00:00
nicm
3f86d6d460 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).
2020-04-13 15:55:51 +00:00
Thomas Adam
b117c3b812 Merge branch 'obsd-master' 2020-04-13 10:30:00 +01:00
nicm
c20eb0c0ae Make struct cmd local to cmd.c and move it out of tmux.h. 2020-04-13 08:26:27 +00:00
Thomas Adam
8a57d14f4b Merge branch 'obsd-master' 2020-03-26 11:11:37 +00:00
nicm
8a838b0372 Add support for overlay popup boxes to show text or output temporarily
above the normal layout. These work similarly to menus and are created
with the display-popup command.
2020-03-24 08:09:43 +00:00
Thomas Adam
6d3d47c25b Merge branch 'obsd-master' 2020-01-04 20:01:26 +00:00
nicm
1870cc70ef Add ~ to quoted characters for %%%, reported by tb@. 2020-01-04 18:01:56 +00:00
Thomas Adam
eeedb43ae8 Merge branch 'obsd-master' 2019-10-03 12:01:25 +01:00
nicm
f4c7141f5d Do not lazily use BUFSIZ for "I don't care what size" when building
strings because it is only guaranteed to be 256 bytes and even the
default 1024 is not always enough. Reported by Gregory Pakosz.
2019-10-03 10:24:05 +00:00
Thomas Adam
648471ecee Merge branch 'obsd-master' 2019-08-29 18:02:29 +01:00
nicm
7ce8135138 It is not longer necessary to double-escape ; in %%%, problem reported
by Theo Buehler.
2019-08-29 07:13:48 +00:00
Thomas Adam
3a4cf62aa9 Merge branch 'obsd-master' 2019-07-06 23:02:26 +01:00
nicm
ddf53d6e4e Correctly adjust mouse position if the status line is at the top and
more than one line. GitHub issue 1822.
2019-07-06 20:56:34 +00:00
Nicholas Marriott
8da756c4f0 Restore missing functions. 2019-06-14 16:02:34 +01:00
Thomas Adam
463bd8abb9 Merge branch 'obsd-master' 2019-05-25 18:41:51 +01:00
nicm
d7586d3d65 Use client name when logging command queue. 2019-05-25 10:44:09 +00:00
nicm
930245d7ff Make cmd_log_argv take a printf-like format for the prefix. 2019-05-25 06:58:10 +00:00
Thomas Adam
75aeb733f2 Merge branch 'obsd-master' 2019-05-23 13:02:27 +01:00
nicm
723010ba72 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.
2019-05-23 11:13:30 +00:00
Thomas Adam
aa13bd4016 Merge branch 'obsd-master' 2019-05-10 22:10:38 +01:00
nicm
6dcca5fda4 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.
2019-05-10 18:04:06 +00:00
Thomas Adam
4bc45fc95a Merge branch 'obsd-master' 2019-05-08 21:02:25 +01:00
nicm
a384245c5a Adjust how mouse targets are found so they always have a session, window
and pane.
2019-05-08 18:05:03 +00:00
Thomas Adam
4d505574dc Merge branch 'obsd-master' 2019-05-03 21:02:26 +01:00