Commit graph

3727 commits

Author SHA1 Message Date
Daniel Eklöf
19868c9c8d
main/client: add -D,--working-directory=DIR
This overrides the CWD the slave process chdir()’s into before
exec:ing the client application.
2021-02-12 21:42:53 +01:00
Daniel Eklöf
64a60d12f0
server: send exit-code -1 when we fail to instantiate a new terminal 2021-02-12 21:42:53 +01:00
Daniel Eklöf
2a99c5a093
user-notification: add new function ‘user_notification_add()’ 2021-02-12 21:42:53 +01:00
Daniel Eklöf
df1ed1c8cf
Merge branch 'releases/1.6' 2021-02-12 21:41:53 +01:00
Daniel Eklöf
dcd4f1ca79
meson/pkgbuild: bump version to 1.6.4 2021-02-12 21:27:47 +01:00
Daniel Eklöf
c18e459757
changelog: prepare for 1.6.4 2021-02-12 21:27:15 +01:00
Daniel Eklöf
299904e987
selection: don’t strip formatting C0 control characters in bracketed paste mode
It’s ok to let the receiving end handle formatting C0 control
characters in bracketed paste mode.

In fact, we *must* let them through. Otherwise it is impossible to
paste e.g. tabs into editors and similar applications.
2021-02-12 20:58:37 +01:00
Daniel Eklöf
669544eb0d
Merge branch 'dont-strip-formatting-chars-when-pasting-in-bracketed-paste-mode' 2021-02-12 20:55:48 +01:00
Daniel Eklöf
0da766e505
selection: don’t strip formatting C0 control characters in bracketed paste mode
It’s ok to let the receiving end handle formatting C0 control
characters in bracketed paste mode.

In fact, we *must* let them through. Otherwise it is impossible to
paste e.g. tabs into editors and similar applications.
2021-02-12 15:59:07 +01:00
Daniel Eklöf
caede90544
changelog: use standard signals for SIGCHLD 2021-02-12 10:58:58 +01:00
Daniel Eklöf
036a77194b
config: selection-target: space-optimize the static ‘value’ array 2021-02-12 10:56:38 +01:00
Daniel Eklöf
416e8e7e58
doc: foot.ini: selection-target=none|primary|clipboard|both 2021-02-12 10:56:34 +01:00
Daniel Eklöf
c0bff58d8d
changelog: selection-target=none|primary|clipboard|both 2021-02-12 10:56:28 +01:00
Daniel Eklöf
9db9a0d225
config: add ‘none’ as a possible value for ‘selection-target’
When ‘selection-target’ is set to ‘none’, selecting text does not copy
the text to _any_ clipboard.

This patch also refactors the value parsing to be data driven.
2021-02-12 10:55:50 +01:00
Daniel Eklöf
76e8d3f483
selection: copy selected text to the target configured by ‘selection-target’
Closes #288
2021-02-12 10:55:40 +01:00
Daniel Eklöf
a0afae747b
config: add new option ‘selection-target’
This option controls the clipboard target that selected text should be
copied to.
2021-02-12 10:55:06 +01:00
Daniel Eklöf
79e3a46943
reaper: monitor SIGCHLD using the FDM instead of via a signalfd
In addition to letting the FDM do the low-level signal watching, this
patch also fixes a bug; multiple SIGCHLDs, be it delivered either through a
signal, or via a signalfd, can be coalesced, like all signals.

This means we need to loop on waitpid() with WNOHANG until there are
no more processes to reap.

This in turn requires a small change to the way reaper callbacks are
implemented.

Previously, the callback was allowed to do the wait(). This was
signalled back to the reaper through the callback’s return value.

Now, since we’ve already wait():ed, the process’ exit status is passed
as an argument to the reaper callback.

The callback for the client application has been updated accordingly;
it sets a flag in the terminal struct, telling term_destroy() that the
process has already been wait():ed on, and also stores the exit
status.
2021-02-12 10:53:10 +01:00
Daniel Eklöf
37220fc189
render: block all signals in the rendering threads 2021-02-12 10:53:10 +01:00
Daniel Eklöf
89f49b5bc7
main: monitor SIGINT+SIGTERM using the FDM 2021-02-12 10:53:10 +01:00
Daniel Eklöf
cf1335f258
fdm: add support for managing signals
Add fdm_signal_add() and fdm_signal_del(). Signals added to the fdm
will be monitored, and the provided callback called as “soon as
possible” from the main context (i.e not from the signal handler
context).

Monitored signals are *blocked* by default. We use epoll_pwait() to
unblock them while we’re polling. This allows us to do race-free
signal detection.

We use a single handler for all monitored signals; the handler simply
updates the signal’s slot in a global array (sized to fit SIGRTMAX
signals).

When epoll_pwait() returns EINTR, we loop the global array. The
callback associated with each signal that fired is called.
2021-02-12 10:53:10 +01:00
Daniel Eklöf
ac46e58448
install: add -Dterminfo to list of compile-time options 2021-02-12 10:48:17 +01:00
Daniel Eklöf
a60b7babd3
changelog: -Dterminfo changed from boolean to feature option 2021-02-12 10:48:13 +01:00
Daniel Eklöf
c49eac2147
meson: convert -Dterminfo from a boolean to a feature option
Patch from Jan Beich
2021-02-12 10:48:06 +01:00
Tadeo Kondrak
8a32c5c5c1
ime: Reset terminal's IME state on text_input.leave
To reproduce issue:
- Launch an IME from inside foot
- Type in some preedit text
- Use Ctrl-C to close the IME
- IME text stays in terminal until focus is changed
2021-02-12 10:45:43 +01:00
Daniel Eklöf
6e94da182c
changelog: add section for 1.6.4 2021-02-12 10:44:42 +01:00
Daniel Eklöf
1c8c76708d
Merge branch 'add-missing-short-options-to-usage' 2021-02-12 09:07:13 +01:00
Daniel Eklöf
59b127dc69
main/client: add missing short options to usage (--help output)
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.
2021-02-12 09:02:25 +01:00
Daniel Eklöf
4753d34163
changelog: use standard signals for SIGCHLD 2021-02-11 19:54:55 +01:00
Daniel Eklöf
da7da4cba5
Merge branch 'log-level'
Closes #337
2021-02-11 19:00:09 +01:00
Daniel Eklöf
e5edf7a52b
Merge branch 'fdm-signal-handling' 2021-02-11 18:56:45 +01:00
Daniel Eklöf
23bc3b2179
reaper: monitor SIGCHLD using the FDM instead of via a signalfd
In addition to letting the FDM do the low-level signal watching, this
patch also fixes a bug; multiple SIGCHLDs, be it delivered either through a
signal, or via a signalfd, can be coalesced, like all signals.

This means we need to loop on waitpid() with WNOHANG until there are
no more processes to reap.

This in turn requires a small change to the way reaper callbacks are
implemented.

Previously, the callback was allowed to do the wait(). This was
signalled back to the reaper through the callback’s return value.

Now, since we’ve already wait():ed, the process’ exit status is passed
as an argument to the reaper callback.

The callback for the client application has been updated accordingly;
it sets a flag in the terminal struct, telling term_destroy() that the
process has already been wait():ed on, and also stores the exit
status.
2021-02-11 18:55:30 +01:00
Daniel Eklöf
34699ad3b2
render: block all signals in the rendering threads 2021-02-11 18:55:30 +01:00
Daniel Eklöf
7c3a126b22
main: monitor SIGINT+SIGTERM using the FDM 2021-02-11 18:55:30 +01:00
Daniel Eklöf
863ae1143f
fdm: add support for managing signals
Add fdm_signal_add() and fdm_signal_del(). Signals added to the fdm
will be monitored, and the provided callback called as “soon as
possible” from the main context (i.e not from the signal handler
context).

Monitored signals are *blocked* by default. We use epoll_pwait() to
unblock them while we’re polling. This allows us to do race-free
signal detection.

We use a single handler for all monitored signals; the handler simply
updates the signal’s slot in a global array (sized to fit SIGRTMAX
signals).

When epoll_pwait() returns EINTR, we loop the global array. The
callback associated with each signal that fired is called.
2021-02-11 18:55:21 +01:00
Craig Barnes
5437321f97 main: client: factor out some common code for "--log-level" option 2021-02-11 11:08:18 +00:00
Craig Barnes
1add430b5b Merge branch 'xassert-false' 2021-02-10 21:03:00 +00:00
Craig Barnes
19a5f25b80 Mark slave_exec() as "noreturn" and convert xassert(false) to BUG(...) 2021-02-10 09:18:50 +00:00
Craig Barnes
3c86af52c2 Convert all but 2 remaining uses of xassert(false) to BUG("...") 2021-02-10 09:01:51 +00:00
Daniel Eklöf
c97e5da7c6
Merge branch 'turn-meson-terminfo-option-into-a-feature' 2021-02-09 21:30:12 +01:00
Daniel Eklöf
7698077331
changelog: -d,--log-level 2021-02-09 21:22:16 +01:00
Daniel Eklöf
80cd3df790
completions: fish: -d,--log-level 2021-02-09 21:22:16 +01:00
Daniel Eklöf
2c5beed362
completions: zsh: -d,--log-level 2021-02-09 21:22:16 +01:00
Daniel Eklöf
4ddd2cad91
doc: footclient.1: document -d,--log-level 2021-02-09 21:22:16 +01:00
Daniel Eklöf
50e9cfd2e6
doc: foot.1: document -d,--log-level 2021-02-09 21:22:16 +01:00
Daniel Eklöf
4d42094a64
client: add -d,--log-level 2021-02-09 21:22:16 +01:00
Daniel Eklöf
ca3974cc24
main: add -d,--log-level=[debug,info,warning,error] 2021-02-09 21:22:16 +01:00
Daniel Eklöf
208014d6c9
log: log-level applies to messages logged to stderr too 2021-02-09 20:54:17 +01:00
Daniel Eklöf
fcb524fc72
csi: add 47+1047 (alt screen) to DECRQM 2021-02-09 20:02:29 +01:00
Daniel Eklöf
d16217eca9
Merge remote-tracking branch 'origin/debug-log' 2021-02-09 19:52:53 +01:00
Daniel Eklöf
3d71b74442
install: add -Dterminfo to list of compile-time options 2021-02-09 19:46:06 +01:00