aboutsummaryrefslogtreecommitdiff
path: root/client.c (follow)
Commit message (Collapse)AuthorAgeLines
* spawn-terminal: spawn with all the original command line optionsspawn-terminal-cmdline-argumentsDaniel Eklöf6 days-13/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this, spawn-terminal would spawn a new foot or footclient, but *without* any of the command line options the user started the original foot/footclient with. We did have a hack for --config, but all other options were forgotten in the new instance. This patch fixes this. * term_init() stores the raw argc/argv in the terminal struct. * term_spawn_new() calls spawn() with the stored argc/argv. * for single instances, main() calls term_init() with the unparsed argc/argv. * the client/server protocol is extended to always send the raw argc/argv to the server. * the server calls term_init() with the argc/argv from the client. * bonus: on linux, we now use /proc/self/exe to determine which binary to launch. This means if you run e.g. a foot from your build tree, spawn-terminal will exec _that_ foot, not the system foot. A couple of behavioral changes, and/or side-effects, caused by the above (not exhaustive): * footclient -E: spawn-terminal will not use the _exact_ environment from the original footclient, but will simply pass -E to the new footclient. This means the new instance will inherit the *current* environment of the original instance. * foot htop: spawn-instance will _also_ launch a new foot+htop. Before this patch, spawn-instance would launch a new foot+shell. Closes #1622
* Add support for file:// URLs for initial working directoryairkoala2026-08-29-3/+27
| | | | | | | | | | | This will allow for foot to be registered as a MIME type handler for directories, allowing a "open with foot" action via xdg-open. Some applications pass a simple directory path (eg. qbittorrent) but others pass it as a "file://" URL (lutris), which is also sometimes percent-encoded (calibre) but sometimes not. This patch should be able to handle all 3 of these variants.
* main/client: add --class, an alias for --app-idDaniel Eklöf2026-06-20-0/+1
| | | | | | | | | | | | | | | This is to help e.g. scripts that wants to launch terminal instances in a terminal agnostic way. Many terminals were originally for X11, where the '--class' choice was obvious. When they were ported to Wayland, it made sense for them to keep the '--class' command line option, but have it set the application ID instead (since "class" is not a thing on Wayland). Let's add the alias, but minimally documented. We don't want to _encourage_ its use after all. Closes #2368
* client: add missing <limits.h> (for CHAR_MAX)Daniel Eklöf2025-11-29-6/+7
| | | | Closes #2221
* config: add toplevel-tag=TAGDaniel Eklöf2025-11-12-0/+12
| | | | | | | | | | | Add support for the new xdg-toplevel-tag-v1 Wayland protocol, by exposing a new config option, `toplevel-tag`, and a corresponding command option, `--toplevel-tag` (in both `foot` and `footclient`). This can help the compositor with session management, or custom window rules. Closes #2212
* server/client: add support for sending SIGUSR to footclientDaniel Eklöf2025-08-01-5/+60
| | | | | | | | | | | This patch adds the IPC infrastructure necessary to propagate SIGUSR1/SIGUSR2 from a footclient process to the server process. By targeting a particular footclient instance, only that particular instance changes theme. This is different from when targeting the server process, where all instances change theme. Closes #2156
* main/client: simplify code for printing --version stringCraig Barnes2025-03-14-16/+1
|
* meson: require wayland-protocols >= 1.41Daniel Eklöf2025-03-13-4/+1
|
* render: gamma-correct blendingDaniel Eklöf2025-03-05-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements gamma-correct blending, which mainly affects font rendering. The implementation requires compile-time availability of the new color-management protocol (available in wayland-protocols >= 1.41), and run-time support for the same in the compositor (specifically, the EXT_LINEAR TF function and sRGB primaries). How it works: all colors are decoded from sRGB to linear (using a lookup table, generated in the exact same way pixman generates it's internal conversion tables) before being used by pixman. The resulting image buffer is thus in decoded/linear format. We use the color-management protocol to inform the compositor of this, by tagging the wayland surfaces with the 'ext_linear' image attribute. Sixes: all colors are sRGB internally, and decoded to linear before being used in any sixels. Thus, the image buffers will contain linear colors. This is important, since otherwise there would be a decode/encode penalty every time a sixel is blended to the grid. Emojis: we require fcft >= 3.2, which adds support for sRGB decoding color glyphs. Meaning, the emoji pixman surfaces can be blended directly to the grid, just like sixels. Gamma-correct blending is enabled by default *when the compositor supports it*. There's a new option to explicitly enable/disable it: gamma-correct-blending=no|yes. If set to 'yes', and the compositor does not implement the required color-management features, warning logs are emitted. There's a loss of precision when storing linear pixels in 8-bit channels. For this reason, this patch also adds supports for 10-bit surfaces. For now, this is disabled by default since such surfaces only have 2 bits for alpha. It can be enabled with tweak.surface-bit-depth=10-bit. Perhaps, in the future, we can enable it by default if: * gamma-correct blending is enabled * the user has not enabled a transparent background
* client: port bfabc5450b3a01c7d701809b3cf6158220ea289e to footclientDaniel Eklöf2025-01-24-1/+1
|
* features: add +/-system-bell to version outputDaniel Eklöf2025-01-17-2/+4
|
* util: add streq() function and use in place of strcmp(...) == 0Craig Barnes2024-02-05-4/+4
|
* Codespell fixesDaniel Eklöf2023-10-03-1/+1
|
* wayland: cursor-shape-v1 is now always availableDaniel Eklöf2023-08-07-2/+1
| | | | Since we're requiring wayland-protocols >= 1.32
* wayland: fractional-scale-v1 is now always availableDaniel Eklöf2023-08-07-2/+1
| | | | Since we're requiring wayland-protocols >= 1.32
* footclient: fallback logic when socket paths don't existMax Gautier2023-07-21-6/+9
| | | | | | Even if WAYLAND_DISPLAY / XDG_RUNTIME_DIR are defined, if we can't find the corresponding socket, we fallback to the path used when they are not defined.
* main/client: add a version feature flag for cursor-shapeDaniel Eklöf2023-07-03-1/+2
|
* feature: add a feature flag (for --version) for fractional scalingDaniel Eklöf2023-06-29-1/+3
|
* change default log level to WARNINGAntoine Beaupré2022-11-22-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default foot output looks like this, in Debian testing "bookworm" at the time of writing: anarcat@angela:pubpaste$ foot true info: main.c:421: version: 1.13.1 +pgo +ime +graphemes -assertions info: main.c:428: arch: Linux x86_64/64-bit info: main.c:440: locale: fr_CA.UTF-8 info: config.c:3003: loading configuration from /home/anarcat/.config/foot/foot.ini info: fcft.c:338: fcft: 3.1.5 +graphemes -runs +svg(nanosvg) -assertions info: fcft.c:377: fontconfig: 2.13.1, freetype: 2.12.1, harfbuzz: 5.2.0 info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=8.00pt/8px, dpi=75.00 info: wayland.c:1353: eDP-1: 2256x1504+0x0@60Hz 0x095F 13.32" scale=2 PPI=205x214 (physical) PPI=136x143 (logical), DPI=271.31 info: wayland.c:1509: requesting SSD decorations info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Bold.otf: size=24.00pt/32px, dpi=96.00 info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=24.00pt/32px, dpi=96.00 info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Bold.otf: size=24.00pt/32px, dpi=96.00 info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=24.00pt/32px, dpi=96.00 info: terminal.c:700: cell width=19, height=39 info: terminal.c:588: using 16 rendering threads info: wayland.c:859: using SSD decorations info: main.c:680: goodbye anarcat@angela:pubpaste$ That's 17 lines of output that are *mostly* useless for most use cases. I might understand having this output during the project's startup, when it's helpful for diagnostics, but now Foot just mostly works everywhere, and I've never had a use for any of that stuff in the (arguably short) time I've been using Foot so far. And if I do, there's the `--log-level` commandline option to tweak this. At first, I looked at tweaking the log level through the config file. But as explained in this issue: https://codeberg.org/dnkl/foot/issues/1142 ... there's a chicken and egg problem there that makes it hard to implement and possibly confusing for users as well. There's also the possibility for users to change the shortcut with which they start foot, for example a `.desktop` file so that menu systems that support those start foot properly. But that only works in that environment, and not through the so many things that will just call `foot` and hope it will do the right thing. In my case, I have `foot` hardcoded in a lot of places now, between sway and waybar, and this is only going to grow. Others have suggested adding the flag to a $TERMINAL global variable, but that won't help .desktop users. So, instead of playing whack-a-mole with the log levels, just make it so that, by default, foot is silent. This is actually one of the [basics of UNIX philosophy][1]: > Rule of Silence: When a program has nothing surprising to say, it > should say nothing. And yes, I am aware I am severely violating that principle by writing a way too long commit log for a one-line patch, but there you go, I figured it was good to document the why of this properly. [1]: https://web.archive.org/web/20031102053334/http://www.faqs.org/docs/artu/ch01s06.html
* main/client: use $PWD for cwd, when $PWD is validDaniel Eklöf2022-10-02-0/+22
| | | | | | | | | If $PWD is set, and its resolved path matches the *actual* working directory, use $PWD for cwd when instantiating the terminal. This makes a difference when $PWD refers to a symlink; before this patch, we’d instantiate the terminal in the *resolved* path. Now it’ll use the symlink instead.
* client/slave: explictly add ‘extern char **environ’Daniel Eklöf2022-04-12-0/+2
| | | | It’s not in any header files on FreeBSD.
* client: refactor: add send_string_list() functionDaniel Eklöf2022-04-12-20/+20
| | | | Use it to send ‘overrides’ and ‘envp’
* client: add -E,--client-environmentDaniel Eklöf2022-04-12-24/+61
| | | | | | | | | | | | | | | | | When this option is used, the child process in the new terminal instance will inherit its environment from the footclient process, instead of the foot server’s. Implemented by sending (yet another) dynamic string list as part of the client -> server setup packet. When the new option is *not* used, the setup packet is now 2 bytes larger than before. On the server side, the slave process now uses execvpe() instead of execvp(). There’s plumbing to propagate a new ‘envp’ argument from term_init() all the way down to slave_exec(). If ‘envp’ is NULL, we use ‘environ’ instead (thus matching the old behavior of execvp()). Closes #1004
* Explicitly initialize sigaction::sa_mask members with sigemptyset(3)Craig Barnes2022-02-12-1/+2
| | | | | | | | | | | | | | | | | | | | Not doing so before calling sigaction(3) is "undefined" according to POSIX[1]: > Applications shall call either sigemptyset() or sigfillset() at least > once for each object of type sigset_t prior to any other use of that > object. If such an object is not initialized in this way, but is > nonetheless supplied as an argument to any of pthread_sigmask(), > sigaction(), sigaddset(), sigdelset(), sigismember(), sigpending(), > sigprocmask(), sigsuspend(), sigtimedwait(), sigwait(), or > sigwaitinfo(), the results are undefined. The use of designated initializers means that sa_mask members were still being initialized, but sigset_t is an opaque type and implicit initialization doesn't necessarily produce the same results as using sigemptyset(3) (although it typically does on most implementations). [1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaddset.html
* foot{,client}: handle argc == 0Daniel Eklöf2022-01-01-3/+5
| | | | | | | | | | | | | | Our getopt_long() based argument parser would (correctly) break out of the while loop immediately. However, we would then proceed and decrement ‘argc’ by 1, resulting in it being -1. This was then passed to the terminal constructor, which passed it on to the client application fork+exec logic. That finally resulted in an exec(3) failure: err: slave.c:339: SHELL=/bin/zsh: failed to execute: No such file or directory err: fdm.c:215: no such FD: 7 info: main.c:604: goodbye
* foot/client: implement xdga client activationRonan Pigott2021-11-01-1/+18
| | | | | | | | | | | This is an application of the xdg activation protocol that will allow compositors to associate new foot toplevels with the command that launched them. footclient receives an activation token from the launcher which the compositor can use to track application startup. It passes the token to the foot server, which then activates the new window with the token to complete the startup sequence.
* client: use MSG_NOSIGNAL in send(3)Daniel Eklöf2021-10-30-1/+1
| | | | | | | MSG_NOSIGNAL Requests not to send the SIGPIPE signal if an attempt to send is made on a stream-oriented socket that is no longer connected. The [EPIPE] error shall still be returned.
* client: handle partial writes in send(3)Daniel Eklöf2021-10-29-7/+28
|
* foot/client: version info: add +/- assertionsDaniel Eklöf2021-10-23-2/+3
|
* main/client: add no-op "-e" command-line optionCraig Barnes2021-09-18-2/+6
|
* main/client: replace some uses of printf() with puts() in print_usage()Craig Barnes2021-09-18-19/+20
| | | | | | FOOT_DEFAULT_TERM is a string literal passed as a -D argument to the compiler, so it can just be concatenated with the other string literals, instead of being formatted with printf().
* terminfo: install to $datadir/foot/terminfo by default, append to TERMINFO_DIRSDaniel Eklöf2021-08-17-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of 2021-07-31, ncurses ships its own version of foot’s terminfo. Since: * It doesn’t have the non-standard Sync,Tc,setrgbf,setrgbb capabilities. * It doesn’t set hs,fsl,dsl (statusbar). * We want to be able to update our termminfo without waiting for an ncurses release. * Foot should be installable and usable on Linux systems that doesn’t have the latest ncurses. we still want to ship our own version. We can however not install it to the default terminfo location (e.g. /usr/share/terminfo), since it will collide with the ncurses provided files. Our options are to either rename our terminfo to something else, or to keep the name, but install our terminfo files somewhere else. The first option would be the easy one. However, I think it makes sense to use the same name. For example, a user that SSH’s into a remote system that does *not* have our own version installed, but *does* have the ncurses one, will gracefully fall back to that one, which is better than manually having to set e.g. TERM=xterm-256color. Now, if we want to use the same name, we need to install it somewhere else. But where? And how do we ensure our version is preferred over the ncurses one? I opted to $datadir/foot/terminfo (e.g. /usr/share/foot/terminfo) by default. It makes it namespaced to foot (i.e. we’re not introducing a new “standard” terminfo location), thus guaranteeing it wont collide with ncurses. To enable applications to find it, we export TERMINFO_DIRS. This is a list of *additional* directories to search for terminfo files. If it’s already defined, we *append* to it. The nice thing with this is, if there’s no terminfo in that location (e.g. when you SSH into a remote), the default terminfo location is *also* searched. But only *after* having searched through TERMINFO_DIRS. In short: our version is preferred, but the ncurses one (or an older version of our terminfo package!) will be used if ours cannot be found. To enable packagers full control over the new behavior, the existing meson command line options have been modified, and a new option added: -Dterminfo=disabled|enabled|auto: *build* and *install* the terminfo files. -Dcustom-terminfo-install-location=<path>: *where* the terminfo files are expected to be found. This *needs* to be set *even* if -Dterminfo=disabled. For example, if the packaging script builds and packages the terminfo files separate from the regular foot build. The path is *relative to $prefix*, and defaults to $datadir/foot/terminfo. This is the value that will be appended to TERMINFO_DIRS. Note that you can set it to ‘no’, in which case foot will *not* set/modify TERMINFO_DIRS. Only do this if you don’t intend to package foot’s terminfo files at all (i.e. you plan on using the ncurses ones only). -Ddefault-terminfo=foot. Allows overriding the default TERM value. This should only be changed if the target platform doesn’t support terminfo files. Closes #671
* client: remove info log of client app’s exit-codeDaniel Eklöf2021-07-30-2/+0
|
* log: add LOG_CLASS_NONE and use as initializer for log_levelCraig Barnes2021-06-26-16/+16
| | | | | | | | | | | | This means that logging will be completely disabled until log_init() has been called, which is useful to prevent log spam when running UNITTEST{} blocks in debug builds. Note that this doesn't change the default log level at runtime, which was already being set to LOG_CLASS_INFO in main.c and client.c. The new log level is also exposed to the command-line interface as `--log-level=none`, which allows disabling logging entirely.
* client: add +/-graphemes to version outputDaniel Eklöf2021-06-24-2/+3
|
* client: make sure ‘fd’ is initialized in all error pathsDaniel Eklöf2021-06-23-1/+2
|
* client: add and use function push_override()Daniel Eklöf2021-06-23-48/+63
| | | | | | | | | | | | | | | | | | | | | We now track override data (length + malloc:ed string) in a struct, and push this struct to our overrides linked list. There’s a new function, push_override() that takes a string, calculates its length, strdup() it and pushes it to the linked list. This function also length-checks the string, to ensure we don’t overflow. This way, we don’t have to loop the overrides list twice; once when calculating the total length of all overrides, and once when sending the overrides to the server. Now, we can update the total length as we add overrides (i.e while parsing the command line, instead of afterwards). This means we only have to loop the list once, and that’s when sending it. This also means there’s no longer any need to malloc an array holding the lengths of each override.
* client: implement -o,--overrideDaniel Eklöf2021-06-23-1/+7
|
* client: send overrides for everything that is publicly visible in the confDaniel Eklöf2021-06-23-59/+81
| | | | | | | | | Send a generic “overrides” list to the server, containing options in text, on the format “section.key=value”. This reduces the size of the base client/server protocol packet, as well as opens up for a generic -o,--override command line option (not yet implemented).
* main/client: change exit codeDaniel Eklöf2021-05-04-1/+1
| | | | | | | | * foot exits with -26/230 * footclient exits with -36/220 This is to give each application a range of exit codes. Currently unused, but we may want to change this in the future.
* foot/footclient: use a custom exit code when foot/footclient fail to runDaniel Eklöf2021-05-04-7/+12
| | | | | | | | | | | | | | | | | | | Normally, foot and footclient uses the exit code from the client application (i.e. the shell). However, foot (or footclient) itself may fail to run; if run outside of a Wayland session, or no fonts are installed, or the client application/shell cannot be found (“foot lsdjfldsjf”) etc. Up until now, there has been no way to differentiate these kind of failures from the client application exiting with code 1. This patch changes foot’s failure exit code to -27/229, and footclient’s to -28/228. Note that footclient will exit with foot’s -27/229 if footclient ran successfully, but the foot server failed to instantiate a new window. Closes #466.
* features: --version now logs +/-pgoDaniel Eklöf2021-03-26-2/+4
| | | | That is, whether the binary was compiled with PGO or not.
* add option to detach the client process from the terminal instanceFelipe Trzaskowski2021-03-13-1/+9
|
* client: repair usage outputDaniel Eklöf2021-03-12-2/+2
|
* client: remove excess ‘-’ from ‘--log-level’ in usageDaniel Eklöf2021-03-12-1/+1
|
* client: -D,--working-directory: check path exists and is a directoryDaniel Eklöf2021-02-13-1/+8
|
* main/client: add -D,--working-directory=DIRDaniel Eklöf2021-02-12-6/+15
| | | | | This overrides the CWD the slave process chdir()’s into before exec:ing the client application.
* main/client: add missing short options to usage (--help output)Daniel Eklöf2021-02-12-5/+5
| | | | | | | | | | | | | | | | | | Initially, these options *did not* have short options. Then, in e81388336750a20a2da98a57e9726c8ba1b481e3, 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 8eaa1959904ecff0e7e75d152220344457912f76, 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 8eaa1959904ecff0e7e75d152220344457912f76 says the options have now been included in usage(), they were in fact *not* added to usage. This patch does just that.
* main: client: factor out some common code for "--log-level" optionCraig Barnes2021-02-11-29/+8
|
* client: add -d,--log-levelDaniel Eklöf2021-02-09-14/+54
|
* client: explicitly use a 64-bit type for ‘total_len’Daniel Eklöf2021-01-23-1/+1
| | | | | | | | 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)) || ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* client/server: switch to POSIX header for sockaddr_unJan Beich2021-01-21-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | client.c:13:10: fatal error: 'linux/un.h' file not found #include <linux/un.h> ^~~~~~~~~~~~ client.c:195:24: error: variable has incomplete type 'struct sockaddr_un' struct sockaddr_un addr = {.sun_family = AF_UNIX}; ^ client.c:195:12: note: forward declaration of 'struct sockaddr_un' struct sockaddr_un addr = {.sun_family = AF_UNIX}; ^ server.c:11:10: fatal error: 'linux/un.h' file not found #include <linux/un.h> ^~~~~~~~~~~~ server.c:307:24: error: variable has incomplete type 'struct sockaddr_un' struct sockaddr_un addr; ^ server.c:307:12: note: forward declaration of 'struct sockaddr_un' struct sockaddr_un addr; ^ server.c:347:24: error: variable has incomplete type 'struct sockaddr_un' struct sockaddr_un addr = {.sun_family = AF_UNIX}; ^ server.c:347:12: note: forward declaration of 'struct sockaddr_un' struct sockaddr_un addr = {.sun_family = AF_UNIX}; ^ server.c:394:24: error: variable has incomplete type 'struct sockaddr_un' struct sockaddr_un addr = {.sun_family = AF_UNIX}; ^ server.c:394:12: note: forward declaration of 'struct sockaddr_un' struct sockaddr_un addr = {.sun_family = AF_UNIX}; ^
* debug: rename assert() to xassert(), to avoid clashing with <assert.h>Craig Barnes2021-01-16-1/+1
|
* Print stack trace on assert() failure or when calling fatal_error()Craig Barnes2021-01-16-1/+1
| | | | | | Note: this uses the __sanitizer_print_stack_trace() function from the AddressSanitizer runtime, so it only works when AddressSanitizer is in use.
* features: include compile-time enable/disable state of features when printing versionDaniel Eklöf2020-12-07-1/+11
|
* client: add new "--window-size-*" options to docs and CHANGELOG.mdCraig Barnes2020-11-22-0/+2
|
* client: add "--window-size-pixels" and "--window-size-chars" optionsCraig Barnes2020-11-22-13/+37
|
* client: fix handling of "-m" command-line flagCraig Barnes2020-11-22-1/+1
|
* client: add missing options to getopt_long(3) optstring argumentCraig Barnes2020-11-21-1/+1
|
* client: we added argv lengths twiceDaniel Eklöf2020-11-21-1/+0
|
* client: avoid doing a signed vs. unsigned comparisonDaniel Eklöf2020-11-21-1/+1
|
* client/server: simplify setup packet handlingDaniel Eklöf2020-11-21-75/+58
| | | | | | 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.
* client: let getopt_long(3) print error messagesDaniel Eklöf2020-11-10-6/+1
| | | | Closes #191
* Convert most dynamic allocations to use functions from xmalloc.hCraig Barnes2020-08-08-1/+2
|
* server/client: use $WAYLAND_DISPLAY instead of $XDG_SESSION_ID in default socket pathDaniel Eklöf2020-08-02-5/+8
| | | | | | | | | 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.
* doc: foot.1: fix default path in -s,--serverDaniel Eklöf2020-08-02-1/+1
| | | | | | | | | | | | | | | | | | | 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.
* client/server: implement '--hold' in footclientDaniel Eklöf2020-05-26-0/+13
|
* main/client: be POSIXLY_CORRECT when parsing command lineDaniel Eklöf2020-05-08-3/+3
| | | | | | | | | | | | | | | | | | | | 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
* conf: add 'title' conf option and --title command line optionDaniel Eklöf2020-04-01-0/+16
|
* conf: add app-id config option and --app-id command line optionDaniel Eklöf2020-04-01-10/+25
|
* client: add --maximized and --fullscreenDaniel Eklöf2020-03-27-0/+28
| | | | | | | | | 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: log path we actually tried to connect to (and failed)Daniel Eklöf2020-03-10-1/+1
|
* client: update --server-socket usage to mention XDG_SESSION_IDDaniel Eklöf2020-03-10-1/+1
|
* server/client: add XDG_SESSION_ID to the default socket pathDaniel Eklöf2020-03-09-1/+4
| | | | This allows multiple foot servers to run in multiple sessions.
* client: make sure 'cwd' is in scope of all goto'sDaniel Eklöf2020-02-20-1/+3
|
* client: allocate current working directory buffer dynamicallyDaniel Eklöf2020-02-20-2/+14
|
* slave: prefix argv[0] with a '-' when spawning a login-shellDaniel Eklöf2020-02-20-0/+6
|
* client: add --login-shell command line optionDaniel Eklöf2020-02-20-0/+7
|
* main: add --print-pid=FILE|FDDaniel Eklöf2020-02-05-5/+22
| | | | | When specified, our PID is written to the specified file (or FD), after we've successfully started up.
* client/server: client sends its CWD to serverDaniel Eklöf2019-12-21-0/+12
|
* log: caller can control syslog levelDaniel Eklöf2019-12-17-1/+1
|
* client: strncpy() size limit must be less than destination sizeDaniel Eklöf2019-12-14-1/+1
|
* client: add missing break after handling -t,--termDaniel Eklöf2019-12-14-0/+1
|
* client: add 's:' to the list of recognized short optionsDaniel Eklöf2019-12-14-1/+1
|
* client: initialize/deinitialize the logging systemDaniel Eklöf2019-12-14-0/+2
|
* client: add -s,--server-socket command line optionDaniel Eklöf2019-12-14-16/+34
| | | | | This allows the user to override the default path (XDG_RUNTIME_DIR/foot.sock) we try to connect to.
* server/client: harden reading of initialization data, and make asyncDaniel Eklöf2019-11-05-2/+21
| | | | | | | | | | | | | | | | | | | | * 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.
* client: bug: verify argv was sent correctlyDaniel Eklöf2019-11-01-1/+1
| | | | We checked we had written 2 bytes (sizeof(len)), not <len> bytes.
* client: add debug logging of argc/argvDaniel Eklöf2019-11-01-0/+4
|
* client: register signal handler for SIGTERM tooDaniel Eklöf2019-11-01-1/+2
|
* client/server: add -t,--term to footclientDaniel Eklöf2019-11-01-2/+18
|
* client: add long options for --verbose and --helpDaniel Eklöf2019-11-01-1/+7
|
* client: a standalone binary that connects to a foot --serverDaniel Eklöf2019-11-01-0/+130