mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
config: add 'blink' option to cursor section in footrc
This option controls whether the default cursor should blink or not. The default is to *not* blink.
This commit is contained in:
parent
7f65bd1c20
commit
a259eda535
7 changed files with 19 additions and 2 deletions
|
|
@ -19,6 +19,9 @@
|
|||
* Terminfo entries for keypad keys: `ka1`, `ka2`, `ka3`, `kb1`, `kb3`,
|
||||
`kc1`, `kc2`, `kc3`, `kp5`, `kpADD`, `kpCMA`, `kpDIV`, `kpDOT`,
|
||||
`kpMUL`, `kpSUB` and `kpZRO`.
|
||||
* **blink** option to `footrc`; a boolean that lets you control
|
||||
whether the cursor should blink or not by default. Note that
|
||||
applications can override this.
|
||||
|
||||
|
||||
### Changed
|
||||
|
|
@ -108,6 +111,7 @@
|
|||
`11t`, `13t`, `13;2t`, `14t`, `14;2t`, `15t`, `19t`.
|
||||
* Unicode combining characters.
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
* Spaces no longer removed from zsh font name completions.
|
||||
|
|
|
|||
4
config.c
4
config.c
|
|
@ -363,6 +363,9 @@ parse_section_cursor(const char *key, const char *value, struct config *conf,
|
|||
}
|
||||
}
|
||||
|
||||
else if (strcmp(key, "blink") == 0)
|
||||
conf->cursor.blink = str_to_bool(value);
|
||||
|
||||
else if (strcmp(key, "color") == 0) {
|
||||
char *value_copy = strdup(value);
|
||||
const char *text = strtok(value_copy, " ");
|
||||
|
|
@ -873,6 +876,7 @@ config_load(struct config *conf, const char *conf_path)
|
|||
|
||||
.cursor = {
|
||||
.style = CURSOR_BLOCK,
|
||||
.blink = false,
|
||||
.color = {
|
||||
.text = 0,
|
||||
.cursor = 0,
|
||||
|
|
|
|||
1
config.h
1
config.h
|
|
@ -33,6 +33,7 @@ struct config {
|
|||
|
||||
struct {
|
||||
enum cursor_style style;
|
||||
bool blink;
|
||||
struct {
|
||||
uint32_t text;
|
||||
uint32_t cursor;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,12 @@ applications can change these runtime.
|
|||
|
||||
*style*
|
||||
Configures the default cursor style, and is one of: _block_, _bar_
|
||||
or _underline_. Default: _block_.
|
||||
or _underline_. Note that this can be overridden by
|
||||
applications. Default: _block_.
|
||||
|
||||
*blink*
|
||||
Boolean. Enables blinking cursor. Note that this can be overridden
|
||||
by applications. Default: _no_.
|
||||
|
||||
*color*
|
||||
Two RRGGBB values specifying the foreground (text) and background
|
||||
|
|
|
|||
1
footrc
1
footrc
|
|
@ -13,6 +13,7 @@
|
|||
[cursor]
|
||||
# style=block
|
||||
# color=111111 dcdccc
|
||||
# blink=no
|
||||
|
||||
[colors]
|
||||
# alpha=1.0
|
||||
|
|
|
|||
|
|
@ -844,10 +844,11 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper,
|
|||
.alpha = conf->colors.alpha,
|
||||
},
|
||||
.origin = ORIGIN_ABSOLUTE,
|
||||
.default_cursor_blink = conf->cursor.blink,
|
||||
.default_cursor_style = conf->cursor.style,
|
||||
.cursor_style = conf->cursor.style,
|
||||
.cursor_blink = {
|
||||
.active = false,
|
||||
.active = conf->cursor.blink,
|
||||
.state = CURSOR_BLINK_ON,
|
||||
.fd = cursor_blink_fd,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -296,6 +296,7 @@ struct terminal {
|
|||
enum { CURSOR_BLINK_ON, CURSOR_BLINK_OFF } state;
|
||||
int fd;
|
||||
} cursor_blink;
|
||||
bool default_cursor_blink;
|
||||
struct {
|
||||
uint32_t text;
|
||||
uint32_t cursor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue