mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-13 05:33:51 -04:00
commit
e7b8f95af7
6 changed files with 63 additions and 7 deletions
|
|
@ -38,6 +38,11 @@
|
||||||
selection mode to 'character-wise' when extending a selection.
|
selection mode to 'character-wise' when extending a selection.
|
||||||
* `DECSET` `47`, `1047` and `1048`.
|
* `DECSET` `47`, `1047` and `1048`.
|
||||||
* FreeBSD support (https://codeberg.org/dnkl/foot/issues/238).
|
* FreeBSD support (https://codeberg.org/dnkl/foot/issues/238).
|
||||||
|
* `selection-target=none|primary|clipboard|both` to `foot.ini`. It can
|
||||||
|
be used to configure which clipboard(s) selected text should be
|
||||||
|
copied to. The default is `primary`, which corresponds to the
|
||||||
|
behavior in older foot releases
|
||||||
|
(https://codeberg.org/dnkl/foot/issues/288).
|
||||||
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
||||||
23
config.c
23
config.c
|
|
@ -673,6 +673,28 @@ parse_section_main(const char *key, const char *value, struct config *conf,
|
||||||
conf->notify.argv = argv;
|
conf->notify.argv = argv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (strcmp(key, "selection-target") == 0) {
|
||||||
|
static const char values[][12] = {
|
||||||
|
[SELECTION_TARGET_NONE] = "none",
|
||||||
|
[SELECTION_TARGET_PRIMARY] = "primary",
|
||||||
|
[SELECTION_TARGET_CLIPBOARD] = "clipboard",
|
||||||
|
[SELECTION_TARGET_BOTH] = "both",
|
||||||
|
};
|
||||||
|
|
||||||
|
for (size_t i = 0; i < ALEN(values); i++) {
|
||||||
|
if (strcasecmp(value, values[i]) == 0) {
|
||||||
|
conf->selection_target = i;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_AND_NOTIFY_ERR(
|
||||||
|
"%s:%d: [default]: %s: invalid 'selection-target'; "
|
||||||
|
"must be one of 'none', 'primary', 'clipboard' or 'both",
|
||||||
|
path, lineno, value);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
LOG_AND_NOTIFY_ERR("%s:%u: [default]: %s: invalid key", path, lineno, key);
|
LOG_AND_NOTIFY_ERR("%s:%u: [default]: %s: invalid key", path, lineno, key);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -2127,6 +2149,7 @@ config_load(struct config *conf, const char *conf_path,
|
||||||
.render_worker_count = sysconf(_SC_NPROCESSORS_ONLN),
|
.render_worker_count = sysconf(_SC_NPROCESSORS_ONLN),
|
||||||
.server_socket_path = get_server_socket_path(),
|
.server_socket_path = get_server_socket_path(),
|
||||||
.presentation_timings = false,
|
.presentation_timings = false,
|
||||||
|
.selection_target = SELECTION_TARGET_PRIMARY,
|
||||||
.hold_at_exit = false,
|
.hold_at_exit = false,
|
||||||
.notify = {
|
.notify = {
|
||||||
.raw_cmd = NULL,
|
.raw_cmd = NULL,
|
||||||
|
|
|
||||||
6
config.h
6
config.h
|
|
@ -181,6 +181,12 @@ struct config {
|
||||||
char *server_socket_path;
|
char *server_socket_path;
|
||||||
bool presentation_timings;
|
bool presentation_timings;
|
||||||
bool hold_at_exit;
|
bool hold_at_exit;
|
||||||
|
enum {
|
||||||
|
SELECTION_TARGET_NONE,
|
||||||
|
SELECTION_TARGET_PRIMARY,
|
||||||
|
SELECTION_TARGET_CLIPBOARD,
|
||||||
|
SELECTION_TARGET_BOTH
|
||||||
|
} selection_target;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
char *raw_cmd;
|
char *raw_cmd;
|
||||||
|
|
|
||||||
|
|
@ -161,12 +161,6 @@ in this order:
|
||||||
compositor can use this value to e.g. group multiple windows, or
|
compositor can use this value to e.g. group multiple windows, or
|
||||||
apply window management rules. Default: _foot_.
|
apply window management rules. Default: _foot_.
|
||||||
|
|
||||||
*workers*
|
|
||||||
Number of threads to use for rendering. Set to 0 to disable
|
|
||||||
multithreading. Default: the number of available logical CPUs
|
|
||||||
(including SMT). Note that this is not always the best value. In
|
|
||||||
some cases, the number of physical _cores_ is better.
|
|
||||||
|
|
||||||
*bold-text-in-bright*
|
*bold-text-in-bright*
|
||||||
Boolean. When enabled, bold text is rendered in a brighter color
|
Boolean. When enabled, bold text is rendered in a brighter color
|
||||||
(in addition to using a bold font). Default: _no_.
|
(in addition to using a bold font). Default: _no_.
|
||||||
|
|
@ -212,6 +206,17 @@ in this order:
|
||||||
|
|
||||||
Default: _notify-send -a foot -i foot ${title} ${body}_.
|
Default: _notify-send -a foot -i foot ${title} ${body}_.
|
||||||
|
|
||||||
|
*selection-target*
|
||||||
|
Clipboard target to automatically copy selected text to. One of
|
||||||
|
*none*, *primary*, *clipboard* or *both*. Default: _primary_.
|
||||||
|
|
||||||
|
|
||||||
|
*workers*
|
||||||
|
Number of threads to use for rendering. Set to 0 to disable
|
||||||
|
multithreading. Default: the number of available logical CPUs
|
||||||
|
(including SMT). Note that this is not always the best value. In
|
||||||
|
some cases, the number of physical _cores_ is better.
|
||||||
|
|
||||||
|
|
||||||
# SECTION: scrollback
|
# SECTION: scrollback
|
||||||
|
|
||||||
|
|
|
||||||
1
foot.ini
1
foot.ini
|
|
@ -23,6 +23,7 @@
|
||||||
# bell=none
|
# bell=none
|
||||||
# word-delimiters=,│`|:"'()[]{}<>
|
# word-delimiters=,│`|:"'()[]{}<>
|
||||||
# notify=notify-send -a foot -i foot ${title} ${body}
|
# notify=notify-send -a foot -i foot ${title} ${body}
|
||||||
|
# selection-target=primary
|
||||||
# workers=<number of logical CPUs>
|
# workers=<number of logical CPUs>
|
||||||
|
|
||||||
[scrollback]
|
[scrollback]
|
||||||
|
|
|
||||||
18
selection.c
18
selection.c
|
|
@ -1017,7 +1017,23 @@ selection_finalize(struct seat *seat, struct terminal *term, uint32_t serial)
|
||||||
}
|
}
|
||||||
|
|
||||||
xassert(term->selection.start.row <= term->selection.end.row);
|
xassert(term->selection.start.row <= term->selection.end.row);
|
||||||
selection_to_primary(seat, term, serial);
|
|
||||||
|
switch (term->conf->selection_target) {
|
||||||
|
case SELECTION_TARGET_NONE:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SELECTION_TARGET_PRIMARY:
|
||||||
|
selection_to_primary(seat, term, serial);
|
||||||
|
break;
|
||||||
|
case SELECTION_TARGET_CLIPBOARD:
|
||||||
|
selection_to_clipboard(seat, term, serial);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SELECTION_TARGET_BOTH:
|
||||||
|
selection_to_primary(seat, term, serial);
|
||||||
|
selection_to_clipboard(seat, term, serial);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue