| Commit message (Collapse) | Author | Age | Lines |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.
Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.
For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).
Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.
These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.
For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.
FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.
Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.
Other fcft API changes:
* fcft_glyph_rasterize() -> fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
|
| |\ |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
getline(3) contains an example program at the end, showing its usage.
A few other changes have also been made.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
musl and glibc's *printf() convert NULL strings to "(null)" [0][1], but
this is undefined behaviour.
context.value has to be set to two backspaces, so that the extra colon
is removed. context.key is set to one backspace, so that the extra dot
is removed. context.section is now set to "main" by default, so it is
never NULL.
[0]: https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c#n593
[1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/vfprintf-internal.c;hb=HEAD#l1011
|
| |/ |
|
| |\ |
|
| | |
| |
| |
| | |
Print usage information and exit if the number of arguments is not 3.
|
| | |
| |
| |
| | |
Closes #914
|
| |\ \ |
|
| | | | |
|
| | | | |
|
| |/ /
| |
| |
| |
| | |
If the size we’re trying to set exceeds the configured max size,
truncate instead of failing.
|
| |/
|
|
|
|
|
|
| |
This ensures processes spawned by us (e.g. the shell, new terminal
instances etc) don’t inherit a flawed signal mask, or having signals
unknowingly ignored.
Closes #854
|
| |\ |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In Sway-1.5, sway waits for configure ACKs from hidden windows when
views are being resized. I.e. if you have e.g. a stacked view, with
one or more windows currently not visible, and you resize the stack,
then sway will emit configure events to all windows, and then wait for
ACKs before rendering the resized view.
The problem with this is that sway also does **not** call frame
callbacks on hidden windows. So if we have rendered one frame, and
thus registered a frame callback, we’ll never render any more frames
until the window becomes visible again. Ergo, if you resize the view
interactively, only the first resize actually happens. After that, all
hidden views are “stuck”, causing ACK timeouts.
We worked around this in foot by preempting the frame
callback. I.e. destroying it, and rendering the frame anyway.
This has fixed in sway-1.6, and thus we can remove the workaround.
|
| | |
| |
| |
| | |
Closes #869
|
| |/
|
|
| |
Closes #379
|
| | |
|
| | |
|
| |\
| |
| |
| | |
Closes #900
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In our default mode (roughly equivalent to XTerm’s modifyOtherKeys=1),
alt-tab now emits ESC-tab instead of CSI 27;3;9~.
When modifyOtherKeys=2 is enabled (CSI >4;2m), alt-tab emits the “old”
CSI 27 escape.
This better matches XTerm’s behavior.
Note that other alt-tab combos are ambiguous in XTerm, and thus they
are left unchanged here (i.e. we keep emitting CSI 27 escapes for
them).
Closes #900
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |/
|
|
|
|
|
|
| |
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.
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
sscanf is not very robust. For example,
$ XCURSOR_SIZE="36asdf" foot
works without any errors, and xcursor_size is parsed as 36.
|
| |\| |
|
| |/
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |\ \ |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |\ \ |
|
| | |/ |
|
| |\ \
| |/
|/| |
|
| |/
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |\ |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |\ |
|
| |/
|
|
|
| |
CLOCK_MONOTONIC isn't guaranteed to have the same value on all
platforms, and this makes the code more readable.
|
| | |
|
| |\
| |
| |
| | |
Closes #798
|
| | | |
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
| |
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
|
| |\
| |
| |
| | |
Closes #846
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | | |
|
| | |
| |
| |
| | |
Reply with DCS 1 + r <cap> ST
|
| | |
| |
| |
| |
| |
| | |
This is a “special feature”, similar to “TN” and “RGB”:
Co for termcap colors (or colors for terminfo colors)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | | |
|
| |/
|
|
|
|
|
| |
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
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Foot does not support running under non-UTF8 locales. If we detect a
non-UTF8 locale, we log this and exit with an error.
However, it appears a fairly common situation is this:
user (knowingly or unknowingly) only configures his/hers locale in
e.g. the shell RC files. These aren’t sourced when the compositor is
started via a display manager.
Thus, compositor key binds will fail to launch, and the user typically
has no way of seeing foot’s output.
So, the user proceeds to start another terminal, and from that one
tries launching foot. And it works... (because the shell in the other
terminal sourced the locale configuration).
User is left confused and often don’t know how to debug.
This patch is somewhat hackish; in addition to logging the locale
error, it also pushes a user notification. For this to be visible, we
need to actually start a terminal window.
So, we ignore the configured shell, and we ignore any custom command
line, and instead spawns “/bin/sh -c ‘’”. This allows us to get
something running (that hopefully doesn’t produce too much output we
can’t decode due to the non-UTF8 locale). But, it will exit
immediately. So we also set the --hold flag.
This works, and may be a good enough “solution”. However, it only
works for standalone foot instances, not footclients.
|
| |\
| |
| |
| | |
Closes #883
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As described in #883, creating a block selection (with ctrl+BTN_LEFT),
then *quickly* (within 300ms from) creating a new one, will, in fact,
_not_ create a new block selection, but a ‘select-word-whitespace’
selection (ctrl+BTN_LEFT-2).
A similar effect can be seen with plain selections (BTN_LEFT). Click
and drag to make a selection, but *release*, and make a new selection
within 300ms from the initial button press, and the new selection is
suddenly a word-based selection.
This happens because triggering a binding does *not* reset the button
click counter.
So, shouldn’t we just do that?
No, because we rely on this behavior to handle single-, double- and
triple-click actions. If we were to reset the button click handler,
then we’d have to instead delay triggering the first action with
300ms, which would make things appear laggy. If we don’t do this, it
would be impossible to double- and triple-click, since the
single-click action would keep resetting the click counter.
This patch takes a slightly different approach; we reset the click
counter when the mouse has moved “too much”. For now, “too much” is
when the cursor has moved to a different cell.
This way, single-, double- and triple-clicks continue to work as
before. But, creating actual selections, and then quickly releasing
and starting a new selection produces the expected results.
Closes #883
|
| |
|
|
|
| |
We’re already doing this for keyboard input, and regular clipboard
pastes.
|
| |\
| |
| |
| | |
Closes #876
|
| |/
|
|
|
|
|
|
|
|
|
| |
The compositor may offer version 4, while we’re still linked against
an old libwayland that does not implement version 4.
While we properly #ifdef the callbacks from version 4, we were still
requesting version 4 (if offered by the compositor), even when
compiled against a too old libwayland.
Closes #876
|
| |\ |
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our getopt_long() based argument parser would (correctly) break out of
the while loop immediately. However, we would then proceed and
decrement ‘argc’ by 1, resulting in it being -1.
This was then passed to the terminal constructor, which passed it on
to the client application fork+exec logic. That finally resulted in an
exec(3) failure:
err: slave.c:339: SHELL=/bin/zsh: failed to execute: No such file or directory
err: fdm.c:215: no such FD: 7
info: main.c:604: goodbye
|
| | |
|
| | |
|
| | |
|
| | |
|