| Commit message (Collapse) | Author | Age | Lines |
| ... | |
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this, foot always emitted a CSI if _any_ modifier was
active. XTerm doesn’t behave quite like this. Instead, it appears to
special-case shift somewhat:
If the generated symbol (e.g ‘A’) is the upper case version of the
pressed key’s base symbol (‘a’), and is in the range a-z, emit a CSI.
If not emit a plain symbol:
Examples (Swedish layout):
* shift-a (generated symbol is ‘A’) emits a CSI
* shift-, (generated symbol is ‘;’) emits ‘;’
* shift-alt-, (generated symbol is ‘;’) emits a CSI
Closes #1009
|
| |
|
|
|
| |
This fixes a regression introduced in
5b1f1602bccfb7c37e50a8509f44b24e9aa3b5d1
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Closes #1008
|
| |
|
|
| |
Closes #950
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Checking for specific strings of length 0 or 1 can be done with e.g.:
if (str[0] == '\0') {...}
if (str[0] == '?' && str[1] == '\0') {...}
Doing it this way instead of using strlen(3) means we avoid the
function call overhead and also avoid scanning through more of the
string than is neceessary.
A compiler could perhaps optimize away calls to strlen(3) when the
result is compared to a small constant, but GCC 11.2 only seems to
actually do this[1] for lengths of 0.
[1]: https://godbolt.org/z/qxoW8qqW6
|
| |
|
|
|
|
|
|
| |
The underline cursor is positioned just below regular underlines. A
bug in the positioning logic related to this, sometimes resulted in
the cursor being thinner than what it should be, or even invisible.
Fixes #1005
|
| |
|
|
|
|
|
|
|
| |
This makes the example config `foot.ini` and its man page slightly more
coherent regarding the specification of default values.
Note that the cursor color is not hardcoded like e.g. foreground or
background, thus in the example config, `<inverse foreground/background>`
makes more sense.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Fixes #1000
|
| |
|
|
|
|
| |
Ellipses can look weird when the font is narrow.
Closes #988
|
| | |
|
| |
|
|
|
|
|
|
| |
If a request handler doesn’t define its own put() handler, simply drop
all DCS parameter data. This way, we won’t end up allocating
potentially large buffers for unsupported/unimplemented DCS requests.
Closes #959
|
| |
|
|
|
| |
Grow buffer exponentially, since XTGETTCAP requests can,
theoretically, be very large.
|
| |
|
|
|
| |
Only buffer up to two bytes, as that’s the largest DECRQSS request we
support.
|
| |
|
|
| |
That is, drop the local bsu() and esu() functions.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When matching “untranslated” bindings (by matching the base symbol of
the key, e.g. ctrl+shift+2 in US layout), require that no
non-significant modifiers are active.
This fixes an issue where AltGr was “ignored”, and would cause certain
combinations to match a key binding.
Example: ctrl+altgr+0, on many European layouts matched against the
default ctrl+0 (reset the font size), instead of emitting ^]
To make this work, we now need to filter out “locked”
modifiers (e.g. NumLock and CapsLock). Otherwise having e.g. NumLock
active would prevent *all* untranslated matching to fail.
Closes #983
|
| |
|
|
|
|
|
|
| |
Use the (relatively new) macro __has_include() to check if
stdc-predef.h exists, and only include it if it does.
If stdc-predef.h does not exist, or if the compiler does not implement
__has_include(), stdc-predef.h is *not* included.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In non-bracketed paste mode, we translate \n to \r, and \r\n to
\r. The latter matches XTerm, urxvt, alacritty and kitty. The former
matches alacritty and kitty (xterm and urxvt just blindly replaces all
\n occurrences with \r, meaning \r\n is translated to \r\r.
For some reason, we then unconditionally translated all \r back to \n,
regardless of whether bracketed paste was enabled or not. Unsure
why/where this comes from, but it doesn't match any of the other
terminal emulators I tested.
One example where this caused issues is in older versions of nano (at
least up to 2.9).
Closes #980
|
| |
|
|
|
|
|
|
|
|
|
| |
This is equivalent to DECKPAM/DECKPNM when enabled/disabled, but can
also be saved/restored/queried with XTSAVE/XTRESTORE/DECRQM.
See also:
* https://vt100.net/docs/vt510-rm/DECNKM.html
* https://vt100.net/docs/vt510-rm/DECKPAM.html
* https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-PC-Style-Function-Keys
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Closes #971
|
| |\ \
| |/
|/| |
|
| | |
| |
| |
| |
| |
| | |
With fixed increments of 128 bytes, an OSC 52 copy operation could end
up doing thousands or tens of thousands of realloc(3) calls just to
copy a few MB.
|
| | |
| |
| |
| | |
Closes #963
|
| |/
|
|
|
|
|
|
|
|
| |
This could be triggered by running, for example:
printf '\033P$qrxyz\033\\'
...which would cause a memcmp() of 4 bytes on a 2 byte string literal.
Fixes: #960
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* get_pkgconfig_variable() -> get_variable()
* prog.path() -> prog.full_path()
* meson.build_root() -> meson.global_build_root()
|
| |\
| |
| |
| | |
Closes #604
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
- Particular mention to included systemd user units
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Support for multiples concurrent instances, templated on
WAYLAND_DISPLAY
- Use standard input for the socket file descriptor (inetd style)
- Always use the socket provided by systemd with the systemd user
service
- wayland-instance@.target is intended to be a special target a bit like
graphical-session.target.
|
| |/
|
|
|
|
|
| |
If the argument to --server is parsed as a number, consider it to be a
file descriptor, and use that as a socket.
This is necessary to be able to use socket activation with the server
mode of foot.
|
| |\ |
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When moving the viewport in the scrollback (i.e. “scrolling”), we need
to ensure the viewport is not moved past the beginning, or end, of the
scrollback.
This was previously accomplish by first limiting the number of lines
to scroll to the number of visible rows (i.e the viewport _size_), and
by adjusting the viewport after moving it, to ensure it doesn’t point
into an uninitialized scrollback area etc.
I.e. the implementation was _reactive_.
This patch rewrites the logic to be _proactive_; we now calculate
_where_ the beginning (or end) of the scrollback is, and then how many
lines there is from there, to the viewport. This is our _maximum_
number of lines to scroll.
When done correctly (which I hope this patch does), this allows us to
remove _all_ checks after moving the viewport - we already _know_ it’s
correct, and valid.
As a bonus, we can remove the old limit, where scrolling was only
allowed to be at most a single page.
|
| |\
| |
| |
| | |
Closes #325
|
| | | |
|
| | |
| |
| |
| | |
Use Super+c -> Ctrl+c as example
|
| | | |
|
| | |
| |
| |
| |
| | |
This ensures we detect, and handle, collisions also for key-bindings
specified as overrides.
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
With this, it is now possible to map key combos to custom escapes. The
new bindings are defined in a new section, “text-bindings”, on the
form “string=key combo”.
The string can consist of printable characters, or \xNN style hex
digits:
[text-bindings]
abcd = Control+a
\x1b[A = Control+b Control+c Control+d # map ctrl+b/c/d to UP
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A foot --server instance would exit with code 0, even on failure, if
the number of currently open terminal instances were 0.
This is because ‘ret’ assumed failure, and then tried to set it to
‘success’ after the even loop had terminated, basted on the server’s
current state.
Fix by:
* set ‘ret’ to success just before entering the event loop
* set ‘ret’ to failure when we detect an FDM failure
* don’t try to second-guess success/failure after having exited the
event loop
Closes #943
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
Instead of the somewhat problematic[1] DCS-based equivalent.
[1]: https://codeberg.org/dnkl/foot/issues/459
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Even though it makes little difference to foot which is used in the
terminfo entry, DECSET 2026 has some advantages[1] over the DCS
sequences and we should probably promote the better of the 2 where
possible.
Note: the terminfo string was taken from Nicholas Marriott's
suggestion[2] in the terminal-wg discussion.
[1]: https://codeberg.org/dnkl/foot/issues/459
[2]: https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/2#note_973680
|
| |/
|
|
|
|
|
|
|
|
| |
The other functions that deal with private modes all use 1070 for
term->sixel.use_private_palette. The xterm docs[1] also list this
param as 1070:
> Ps = 1 0 7 0 ⇒ use private color registers for each graphic
Using 1079 seems to have been a mistake in commit 4aa980a6a2ce3c3.
|
| |
|
|
|
| |
Having 3 separately underlined words made it look a bit like 3 separate
parameters, at a glance.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not doing so before calling sigaction(3) is "undefined" according to
POSIX[1]:
> Applications shall call either sigemptyset() or sigfillset() at least
> once for each object of type sigset_t prior to any other use of that
> object. If such an object is not initialized in this way, but is
> nonetheless supplied as an argument to any of pthread_sigmask(),
> sigaction(), sigaddset(), sigdelset(), sigismember(), sigpending(),
> sigprocmask(), sigsuspend(), sigtimedwait(), sigwait(), or
> sigwaitinfo(), the results are undefined.
The use of designated initializers means that sa_mask members were
still being initialized, but sigset_t is an opaque type and implicit
initialization doesn't necessarily produce the same results as using
sigemptyset(3) (although it typically does on most implementations).
[1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaddset.html
|
| |
|
|
|
| |
Instead, loop the viewport and dirty only those cells that are
affected by the palette change.
|
| |\ |
|
| | |
| |
| |
| | |
This effectively reverts commit 31c73f0cf01e1d0bdcd1435136b010c1c1ab442c.
|
| |/
|
|
|
|
|
| |
Fcft-3.0.0 is known to cause crashes. We don’t want anyone ever
compiling foot against it.
Closes #935
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes a compilation error on FreeBSD:
../../foot/render.c:2055:45: error: no member named 'epoll_shim_close' in 'struct config::(anonymous at ../../foot/config.h:254:9)'
conf_color = &term->conf->csd.color.close;
~~~~~~~~~~~~~~~~~~~~~ ^
/usr/local/include/libepoll-shim/epoll-shim/detail/common.h:8:15:
note: expanded from macro 'close': #define close epoll_shim_close
|
| | | |
|
| | |
| |
| |
| |
| | |
This allows us to add helper functions that e.g. compare bindings’ aux
data in a generic way.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
This function resets (clears) all key- and mouse-bindings associated
with the seat.
|
| | | |
|
| | | |
|
| |/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Editors like Vim and Kakoune ship filetypes dosini and ini
respectively. Both use ";" as comment character, which is used for
example by Vim's "gq" command which wraps lines while preserving
comment prefixes.
foot only accepts # comments. I think it's desirable to stick to
a single commenting style (easier to diff configs).
Make Vim accept that by adding modeline to use the "conf"
filetype, which is for "generic Unix config files". We already
have an Emacs modeline at the top, but Vim seems to ignore it.
Kakoune doesn't have that filetype, but a patch has been
proposed to use # whenever it already occurs in the file, see
https://github.com/mawww/kakoune/pull/4537
|
| |\
| |
| |
| | |
Closes #738
|
| | | |
|
| | |
| |
| |
| |
| | |
`text' cursor is not available in lots of cursor themes, but `xterm'
is, so specify `xterm' as a fallback cursor name.
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This function allows setting a custom mouse cursor.
This is done by adding a ‘char*’ member to the term struct. When it is
non-NULL, we *always* use that pointer (the exception being when the
pointer is hidden), while the pointer is over the grid. This is
instead of the hand/beam pointers we otherwise would use.
|
| |
|
|
|
| |
Returns true if the provided cursor name is non-NULL, and exist in the
currently loaded xcursor theme.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch, wl_cursor_theme_get_cursor() was called in the FDM
hook, just before we’re about to update the mouse cursor “for real”.
This relies on seat->pointer.xcursor still being valid. This is true
as long as we’re only using our compiled-in static xcursor names, but
not otherwise.
Now, we call wl_cursor_theme_get_cursor() in render_xcursor_set(). At
this point, we *know* seat->pointer.xcursor is valid.
There is a slight chance of added overhead here, if the client
application is switching mouse grabbing on/off rapidly. Before, the
calls to wl_cursor_theme_get_cursor() would automatically be
throttled.
However, the main point of delaying the actual pointer update to the FDM
hook is to throttle the *Wayland* calls. And this is still happening:
wl_cursor_theme_get_cursor() is client-side only.
|
| |\
| |
| |
| | |
Closes #926
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We calculated the ‘start’ row by adding the number of screen rows to
the current grid offset. This works in most cases. But not when the
offset is close to the wrap-around.
This triggered a crash when we tried to access a row number larger
than the number of available grid rows.
Fix by bounding the start row to the number of grid rows.
This unearthed a second bug, where trying to extract the scrollback
resulted in nothing getting copied.
The extraction logic did:
for (r = start; r != (end + 1); r++)
....
This works, as long as end isn’t start-1. When we try to extract the
entire scrollback, it _is_ start-1.
Fix by rewriting the loop logic to check for r==end *after* copying
the row contents, but *before* incrementing r.
Closes #926
|
| |\
| |
| |
| | |
Closes #924
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When iterating the characters in a selection, we want to go from the
“start” to the “end”, where start is the upper left-most character,
and “end” is the lower right-most character.
There are two things to consider:
* The ‘start’ coordinate may actually sort after the ‘end’
coordinate (user selected from bottom of the window and upward)
* The scrollback wraparound.
What we do is calculate both the star and end coordinates’
scrollback-start relative row numbers. That is, the number of rows
from the beginning of the scrollback. So if the very first
row (i.e. the oldest) in the scrollback is selected, that has the
scrollback-start relative number “0”.
Then we loop from whichever (start or end coordinate) is highest up in
the scrollback, to the “other” coordinate.
|
| | | |
|
| | |
| |
| |
| | |
Closes #924
|
| |/ |
|