Commit Graph

93 Commits

Author SHA1 Message Date
Thomas Adam
d776c9acfc Merge branch 'obsd-master' into master 2021-09-02 10:01:09 +01:00
nicm
329c2c2a91 Change copying arguments to that flags without arguments are inserted
correctly and empty arguments lists do not crash. Fixes crash reported
by & ok mpi@.
2021-09-02 07:11: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
7fe3588e49 Merge branch 'obsd-master' into master 2021-08-23 20:01:09 +01:00
nicm
841ce74b43 args_make_commands_now needs to take an extra reference to the returned
command list since it will be freed already.
2021-08-23 17:05:43 +00:00
Thomas Adam
95a374d7d2 Merge branch 'obsd-master' into master 2021-08-23 16:06:46 +01:00
nicm
210e71edf3 Move command argument parsing common functions and don't bother to parse
again if given a command rather than a string.
2021-08-23 12:33:55 +00:00
Thomas Adam
324f87cf14 Merge branch 'obsd-master' into master 2021-08-22 12:08:05 +01:00
nicm
0084cbef5a Free value properly. 2021-08-21 20:57:52 +00: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
62036121fa Merge branch 'obsd-master' into master 2021-08-21 12:01:41 +01:00
nicm
110ba767e5 Rename a member to match what it will be in future. 2021-08-21 10:28:05 +00: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
d589be6c65 A couple more spacing fixes. 2021-08-20 20:08:30 +00:00
nicm
5f32b7d961 Hide struct args behind a couple of accessor functions. 2021-08-20 19:50:16 +00:00
Thomas Adam
944fde7c57 Merge branch 'obsd-master' into master 2021-08-20 20:01:27 +01:00
nicm
90dd474c3e Expose args_value struct (will be needed soon) and add some missing frees. 2021-08-20 18:59:53 +00:00
nicm
6cbc83c6a6 Add a way to create an empty arguments set. 2021-08-20 17:53:54 +00:00
Thomas Adam
bd3fb2fb10 Merge branch 'obsd-master' 2020-06-12 10:01:19 +01:00
nicm
cf63465eb0 Fix quoting with newlines and single quotes. 2020-06-12 07:10:43 +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
Thomas Adam
967e5f8be3 Merge branch 'obsd-master' 2020-05-26 08:42:55 +01:00
nicm
dc893405e1 Fix some error strings, from Kris Katterjohn. 2020-05-25 18:17:14 +00:00
nicm
beb214bcb3 Add formats for after hook command arguments. 2020-05-16 15:40:04 +00:00
Nicholas Marriott
9991a14e81 Add formats for after hook command arguments. 2020-05-05 06:19:29 +01:00
Thomas Adam
8ae3915cc2 Merge branch 'obsd-master' 2020-04-22 12:01:38 +01:00
nicm
de5163a634 Change so main-pane-width and height can be given as a percentage. 2020-04-22 06:57:13 +00:00
Thomas Adam
b117c3b812 Merge branch 'obsd-master' 2020-04-13 10:30:00 +01:00
nicm
ad38ef6ff4 Print empty arguments properly. 2020-04-12 20:54:28 +00:00
Thomas Adam
5123bb7db4 Merge branch 'obsd-master' 2020-03-21 14:01:27 +00:00
nicm
8828b958f0 Break code to convert an argument as a percentage into a common function. 2020-03-21 13:16:15 +00:00
Thomas Adam
18cfd9befa Merge branch 'obsd-master' 2020-03-17 18:01:27 +00:00
nicm
bd0342b0a7 getopt is not required to set optarg to NULL when there is no argument
and some do not, so set it explicitly each time.
2020-03-17 16:02:38 +00:00
Thomas Adam
98ef369b27 Merge branch 'obsd-master' 2019-07-09 17:02:26 +01:00
nicm
fc2016dbb6 Add a -H flag to send-keys to send literal keys given as hex numbers
(needed for control clients to send mouse sequences). Also add some
format flags for UTF-8 and SGR mouse mode. Requested by Bradley Smith in
GitHub issues 1832 and 1833.
2019-07-09 14:03:12 +00:00
Thomas Adam
03945276f7 Merge branch 'obsd-master' 2019-06-20 09:02:26 +01:00
nicm
cd1fc42df6 Add a -A flag to show-options to show parent options as well. 2019-06-20 07:10:56 +00:00
Thomas Adam
414208aab1 Merge branch 'obsd-master' 2019-05-29 23:02:25 +01:00
nicm
7dced37673 Use VIS_CSTYLE for the arguments and add the missing escapes it can
generate to the parser.
2019-05-29 20:05:14 +00:00
Thomas Adam
c96957583f Merge branch 'obsd-master' 2019-05-28 21:02:28 +01:00
nicm
4382538e4b Do not read past the end of the argument string if it is empty. 2019-05-28 18:30:30 +00:00
Thomas Adam
d4bf4bd7c7 Merge branch 'obsd-master' 2019-05-27 15:02:28 +01:00
nicm
6b332127ca 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.
2019-05-27 12:16:27 +00:00
Thomas Adam
43431e7e84 Merge branch 'obsd-master' 2019-05-23 17:02:25 +01:00
nicm
27bfb56ad5 Break the argument escaping code into a separate function and use it to
escape key bindings in list-keys. Also escape ~ and ; and $ properly.
2019-05-23 14:03:44 +00:00