aboutsummaryrefslogtreecommitdiff
path: root/spawn.c (unfollow)
Commit message (Collapse)AuthorLines
2021-02-25spawn: call setsid() in child processDaniel Eklöf-9/+13
2021-02-24spawn: handle custom stdin/stdout/stderr fds being the sameDaniel Eklöf-3/+10
Allow the caller to pass the same FD (for example, a single /dev/null FD) to spawn(). All we need to do to handle this correctly is ensure we don’t try to close the same FD multiple times.
2021-02-21errno: don’t use ‘_errno’ as a variable name; _ are reserved for use as identifiersDaniel Eklöf-11/+12
2021-02-21spawn/slave: restore signal mask after forkDaniel Eklöf-0/+11
slave: no need to restore signal handlers; they are automatically restored as long as they are not SIG_IGN (which they never are in foot). spawn(): restore signal mask after fork. This fixes an issue where a terminal spawned with ctrl+shift+n did not terminate when its shell exited. Closes #366
2021-02-07notify: break out command template expansion to spawn_expand_template()Daniel Eklöf-0/+80
2021-01-21reaper: add optional callbackDaniel Eklöf-1/+1
When calling ‘reaper_add()’, the caller can provide a callback. If non-NULL, the reaper will call the callback to handle the actual reaping. If the callback is NULL, or if it returns false, the reaper reaps the child process.
2021-01-16debug: rename assert() to xassert(), to avoid clashing with <assert.h>Craig Barnes-1/+1
2021-01-16Print stack trace on assert() failure or when calling fatal_error()Craig Barnes-1/+1
Note: this uses the __sanitizer_print_stack_trace() function from the AddressSanitizer runtime, so it only works when AddressSanitizer is in use.
2020-12-26reaper: add optional callbackDaniel Eklöf-1/+1
When calling ‘reaper_add()’, the caller can provide a callback. If non-NULL, the reaper will call the callback to handle the actual reaping. If the callback is NULL, or if it returns false, the reaper reaps the child process.
2020-10-10selection: use appropriate check for PRIMARY pasteSergey Nazaryev-116/+13
Assume it could be a copy-paste typo. We should check PRIMARY, not CLIPBOARD. Without this fix, we can't use PRIMARY until we copy anything to CLIPBOARD.
2020-08-23log: include 'fmt' in __VA_ARGS__Daniel Eklöf-1/+1
This ensures all calls have at least one __VA_ARGS__ argument, thus making them ISO C99 compliant.
2020-07-15spawn: add optional stdin/stdout/stderr redirection FDsDaniel Eklöf-3/+7
If not -1, spawn() will redirect the child's stdin/stdout/stderr to these FDs.
2020-07-15term: break out fork+exec functionality to a separate fileDaniel Eklöf-0/+72