Initially, these options *did not* have short options. Then, in
e813883367, the short options were added
to footclient’s getopt_long() call.
This was in a sense incorrect. But instead of reverting it, the short
options were made official in
8eaa195990, by adding the short options
to foot, documenting them in the man pages, and adding them to the
shell completions.
Though the commit message of 8eaa195990
says the options have now been included in usage(), they were in
fact *not* added to usage.
This patch does just that.
This fixes an out-of-range comparison in 32-bit builds:
client.c:289:19: error: result of comparison of constant 4294967296 with expression of type 'size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (total_len >= 1llu << (8 * sizeof(uint32_t)) ||
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Instead of writing (and logging errors for) every parameter, one at a
time, send all fixed size data in a single struct, followed by all the
variable length data.
Foot is a Wayland client and cannot be run outside of a Wayland
session. As such, it makes more sense to use $WAYLAND_SESSION instead
of $XDG_SESSION_ID in the default socket path since this makes it
clearer which Wayland session we belong to.
Closes#55.
The documentation incorrectly stated that the default path is
$XDG_RUNTIME_DIR/foot.sock.
The correct default path is
* $XDG_RUNTIME_DIR/foot-$XDG_SESSION_ID.sock
* $XDG_RUNTIME_DIR/foot-no-session.sock
* /tmp/foot.sock
Depending on whether XDG_RUNTIME_DIR and XDG_SESSION_ID has been set
or not.
This also removes the '<>' from the default when XDG_SESSION_ID is not
set.
Closes#53.
This means command line parsing stops when it encounters the first
nonoption argument.
The result is that one no longer need to use '--' to ensure arguments
are passed to the shell/command, instead of parsed by foot.
That is, instead of
foot -- sh -c true
one can now do
foot sh -c true
Arguments to foot *must* go before the command:
foot --fullscreen sh -c true
We now create a copy of the config for each client, and updates it
with the values passed from the client.
Since we're not actually cloning it (and e.g. strdup() all strings
etc) we can't call conf_destroy() to free it, but need to free just
the strings we've replaced.
* Client terminal initialization data is now received
asynchronously. To facilitate this, a couple of minor changes to the
protocol was made:
- The client now starts with sending a 4-byte unsigned integer
with the *total* size of the initialization data (*not*
including the size field itself.
- Strings (TERM variable + argv) are now sent NULL-terminated
* The server allocates a single buffer, and fills it
asynchronously. When full (as indicated by the initial 'total size'
integer), we parse it (taking care not to read outside boundaries
etc, and verifies the lengths (of the TERM variable and argv array)
indicated by the client matches the actual lengths of the strings
received.
* The server now ignores 'unexpected' data received from the client,
after the terminal has been instantiated.