Commit graph

5250 commits

Author SHA1 Message Date
Daniel Eklöf
eb33a0529f
changelog: search for last searched-for string 2022-01-29 17:50:43 +01:00
Daniel Eklöf
1537fd02bd
doc: foot.1: describe how to search for the previous search string 2022-01-29 17:50:43 +01:00
Daniel Eklöf
749d4c0766
doc: foot.1: shortcuts: mention that there are more actions than listed here 2022-01-29 17:50:43 +01:00
Daniel Eklöf
739e7d76b4
search: remember last searched-for string between searches
Regardless of how we exit search mode (commit or cancel), the search
string is remembered.

The next time we enter search mode, the last searched-for string will
be used when searching for the next/prev match (ctrl+r, ctrl+s), and
the search query is empty.
2022-01-29 17:50:42 +01:00
Daniel Eklöf
22266e384b
search: refactor: add add_wchars(), make search_add_chars() use it
search_add_chars() converts the incoming UTF-8 string into a wide-char
string, and then calls add_wchars().

add_wchars() inserts the string into the search buffer, at the current
cursor position.
2022-01-29 17:50:42 +01:00
Daniel Eklöf
2ab569169e
Merge branch 'xcursor-size' 2022-01-29 17:48:16 +01:00
Pranjal Kole
d9cd1749e0 wayland: use strtol() to parse xcursor_size
sscanf is not very robust. For example,
$ XCURSOR_SIZE="36asdf" foot
works without any errors, and xcursor_size is parsed as 36.
2022-01-29 17:52:06 +05:30
Daniel Eklöf
7930652b30
Merge branch 'xcursor-getenv-fix' 2022-01-29 13:06:13 +01:00
Pranjal Kole
fa396cdc33 wayland: use getenv() according to spec
From the NOTES section of getenv(3):
 The string pointed to by the return value of getenv() may be statically
 allocated, and can be modified by a subsequent call to getenv()...

So, previously xcursor_theme could be modified by libc to contain
xcursor_size. This has been fixed by getting xcursor_theme after
computing the value of xcursor_size.
2022-01-29 16:18:19 +05:30
Daniel Eklöf
2cc0a450b4
doc: foot.1: add missing ‘*’ 2022-01-27 18:54:48 +01:00
Daniel Eklöf
034f4171a4
doc: foot.1: use tab for indentation 2022-01-27 18:54:38 +01:00
Daniel Eklöf
49a2f4a9e6
Merge branch 'document-ansi-colors' 2022-01-27 18:49:54 +01:00
Daniel Eklöf
c7836bcd90
readme: add URL mode to the list of keyboard shortcuts 2022-01-27 18:49:04 +01:00
Daniel Eklöf
0c363b83bf
readme: add the new XF86{Copy,Paste} keyboard shortcuts 2022-01-27 18:48:51 +01:00
Daniel Eklöf
90b906d159
doc: foot.1: add URL mode bindings to the list of default keyboard shortcuts 2022-01-27 18:45:53 +01:00
Daniel Eklöf
701d5fe5a4
doc: foot.1: add “enter URL mode” shortcut 2022-01-27 18:45:41 +01:00
Daniel Eklöf
ef855aa132
doc: foot.1: add the new XF86{Copy,Paste} key bindings 2022-01-27 18:45:22 +01:00
Daniel Eklöf
27017cf0b3
Merge branch 'support-copy-paste-keybindings-by-default' 2022-01-25 21:41:07 +01:00
Mark Stosberg
6d76bb0f32 config: support Copy and Paste keycodes by default
These work as expected and don't interfere with anything else.

They are useful on the increasing number of keyboards with custom
firmware. The keycodes enable using the same key combination
for terminals as other apps.

For example: by holding down a layer-switching key with a thumb, the
Copy and Paste key codes can be assigned to the C and V keys on a secondary
layer, making for a natural universal copy/paste key combination.
2022-01-25 15:27:58 -05:00
Daniel Eklöf
9095cb105e
Merge branch 'typo' 2022-01-25 20:47:16 +01:00
Daniel Eklöf
0406ccd4f8
Merge branch 'remove-deprecated-bell-from-ini' 2022-01-25 20:42:15 +01:00
Felix Lechner
f5bb885978 Fix typo in manual page for foot.ini(5). 2022-01-20 10:41:27 -08:00
Mark Stosberg
7885a7ab17 foot.ini: remove deprecated "bell" option.
The "bell" option has been deprecated for 9 months.

The shipped `foot.ini` is used as a reference for setting up
new configs and deprecated options should not be used in new configs.
Further, the "bell=" option is no longer documented in `man foot.ini`,
creating confusion.
2022-01-17 13:14:24 -05:00
Mark Stosberg
0777d3b35f doc: document the 8 ANSI escape codes. 2022-01-15 14:36:45 -05:00
Daniel Eklöf
379e68916e
meson: fix race build order of builtin terminfo
The builtin terminfo is used by dcs.c, which is built as part of the
static library ‘vtlib’. Thus, vtlib needs to depend on the
builtin_terminfo target.
2022-01-15 17:15:45 +01:00
Daniel Eklöf
179ab08161
Merge branch 'clock-gettime' 2022-01-15 17:08:42 +01:00
Pranjal Kole
0da19a81bc replace gettimeofday with clock_gettime
POSIX.1-2008 has marked gettimeofday(2) as obsolete, recommending the
use of clock_gettime(2) instead.

CLOCK_MONOTONIC has been used instead of CLOCK_REALTIME because it is
unaffected by manual changes in the system clock. This makes it better
for our purposes, namely, measuring the difference between two points in
time.

tv_sec has been casted to long in most places since POSIX does not
define the actual type of time_t.
2022-01-15 21:35:45 +05:30
Daniel Eklöf
0d649408a0
Merge branch 'clock' 2022-01-14 16:17:21 +01:00
Érico Nogueira
5af65d897c terminal: use CLOCK_MONOTONIC instead of literal.
CLOCK_MONOTONIC isn't guaranteed to have the same value on all
platforms, and this makes the code more readable.
2022-01-14 11:39:27 -03:00
Daniel Eklöf
b292e735bb
dcs: decrqss: refactor: append_sgr_attr_n() is now a proper function 2022-01-14 14:09:28 +01:00
Daniel Eklöf
f048e08f10
Merge branch 'decrqss'
Closes #798
2022-01-14 13:52:58 +01:00
Daniel Eklöf
7243b094b7
dcs: decrqss: add note about Ps in the reply 2022-01-14 13:52:42 +01:00
Daniel Eklöf
a8681ea440
dcs: decrqss: BUG on invalid cursor style 2022-01-14 13:52:42 +01:00
Daniel Eklöf
add530e66d
dcs: implement DECRQSS
This patch adds support for DECRQSS (request Selection or Setting),
for the following sub-queries:

* DECSTBM   Set Top and Bottom Margins
* SGR       Set Graphic Rendition
* DECSCUSR  Set Cursor Style

Closes #798
2022-01-14 13:52:41 +01:00
Daniel Eklöf
2d3d8ca3d0
Merge branch 'xtgettcap'
Closes #846
2022-01-14 13:49:25 +01:00
Daniel Eklöf
49a8c7fc76
doc: foot.1: XTGETTCAP 2022-01-14 13:45:23 +01:00
Daniel Eklöf
b819d38f1e
changelog: XTGETTCAP 2022-01-14 13:41:17 +01:00
Daniel Eklöf
da9d732855
readme: document XTGETTCAP behavior 2022-01-14 13:41:17 +01:00
Daniel Eklöf
5a032c4c6f
xtgettcap: switch from a table based internal structure, to a single char array
Having the builtin terminfo DB as a table, with one entry per
capability/value pair was ineffective memory-wise - we ended up adding
~20K to the final binary size.

This patch changes the internal representation from a table, to a
single NULL-separated (and NULL-terminated) char array:

  cap1-name \0 cap1-value \0 cap2-name \0 cap2-value \0

The capabilities are still sorted; to lookup a capability we need to
scan from the beginning until we either find a match, or until the
capabilities from the DB sort higher (lexicographically) than the
searched-for capability.

The terminfo char array is 3.3K - more better than before.
2022-01-13 13:42:12 +01:00
Daniel Eklöf
7258e0b005
doc: ctlseq: add XTGETTCAP 2022-01-13 13:42:11 +01:00
Daniel Eklöf
44aad0941f
dcs: xtgettcap: handle boolean capabilities
Reply with DCS 1 + r <cap> ST
2022-01-13 13:42:11 +01:00
Daniel Eklöf
7feab6092c
scripts: generate-builtin-terminfo: add custom capability ‘Co’
This is a “special feature”, similar to “TN” and “RGB”:

   Co for termcap colors (or colors for terminfo colors)
2022-01-13 13:42:11 +01:00
Daniel Eklöf
3fa6bec912
dcs: implement XTGETTCAP
We emit one DCS reply for each queried capability (like Kitty, but
unlike XTerm), as this allows us to a) not skip any capabilities in
the query, and b) reply with correct success/fail flag for each
capability.

We do not batch the entire reply - as soon as the reply for _one_
capability is done, we write it to the PTY.

Closes #846
2022-01-13 13:42:11 +01:00
Daniel Eklöf
1a91cbecc7
uri: move hex2nibble() to util.h 2022-01-13 13:42:11 +01:00
Daniel Eklöf
b8fc56ecb4
script: add generate-builtin-terminfo.py
This script parses a terminfo source file and generates a C header
file with a static struct containing terminfo names and their values.

The table is sorted on the capability names
2022-01-13 13:42:11 +01:00
Daniel Eklöf
467e4f2ef8
test: config: tweak.grapheme-shaping can’t be set when grapheme-clustering has been disabled 2022-01-13 12:26:20 +01:00
Daniel Eklöf
9bd9f55d5a
test: config: test ‘tweak’ section 2022-01-13 12:16:57 +01:00
Daniel Eklöf
891fce6236
config: convert tweak.render_timer to an enum 2022-01-13 12:08:20 +01:00
Daniel Eklöf
69ec74a605
Merge branch 'bad-locale' 2022-01-13 11:48:03 +01:00
Daniel Eklöf
d85feb02ed
main: log locale errors (in addition to adding a user notification) 2022-01-13 11:47:43 +01:00