When num lock override has been enabled via “CSI?1035h” (the default),
keypad is always considered to be in ‘numerical’ mode.
This affects how keypad keys are translated to escape sequences when
Num Lock is active.
The keypad has four modes:
* Num Lock off, numerical mode
* Num Lock off, application mode
* Num Lock on, numerical mode
* Num Lock on, application mode
The keymap is identical for numerical and application mode when Num
Lock is off, meaning the keypad effectively has three different modes.
In XTerm, numerical and application mode _can_ be the same, **if** the
‘numLock’ resource is set to true (the default). It is only when
‘numLock’ is false that the application mode is actually used.
This patch changes foot to do the same. We don’t expose an option, but
do implement “CSI ? 1035”.
Closes#194
- zsh doesn't like "export var+=value", make it two steps
- meson was complaining with "ERROR: Must specify at least one directory name.", so add the relative "../.."
enum selection_scroll_direction is used when extending a selection by
auto-scrolling the terminal content while the mouse is outside the
grid.
What we want is enum selection_direction.
enum selection_scroll_direction is used when extending a selection by
auto-scrolling the terminal content while the mouse is outside the
grid.
What we want is enum selection_direction.
When converting mouse scroll events to keyboard input (in alternate
scroll mode), we need to use seat->mouse_focus, not seat->kbd_focus.
To enable this, break out key press/release handling code to a
separate function that takes an explicit term argument. Call this
function from keyboard_key(), input_repeat() and in alternate scroll
mode.
Closes#179
On some platforms, TIOCSWINSZ has a very large value, >
0x80000000.
On some platforms, the `request` argument to `ioctl(3)` is an `int`.
For platforms where both of the above is true, gcc will warn (and
error out if compiled with `-Werror`) on:
ioctl(fd, TIOCSWINSZ, ...)
To silence this warning, we need to cast `TIOCSWINSZ` to an
integer.
However, doing this on platforms where `request` is an `unsigned long`
will result in `TIOCSWINSZ` being sign-extended (and thus we end up
with an invalid value).
It seems that casting to `unsigned int` works in both cases; it
silences the long -> int conversion warning, while also preserving the
correct value in all cases.
* Don’t de-reference the xkb context/keymap/state if we failed to
instantiate them.
* Don’t try to send a translated utf8 key sequence if the translation
failed.
* Handle xkb_compose_state_get_utf8() and xkb_state_key_get_utf8()
returning more than 64 bytes.
This _may_ fix#171.
Bind to xdg-shell version 2 if available, as this enables us to
track our window’s ‘tiled’ state in the ‘configure’ events.
This in turn allows us to stash the ‘old’ window size when being
tiled, to be used again when restoring the window size when un-tiled.
Handle xkb_compose_table_new_from_locale() returning NULL. When this
happens, log a warning that “dead keys” will be disabled, and make
sure to never de-reference the compose table pointer.
Closes#170
When converting mouse scroll events to keyboard input (in alternate
scroll mode), we need to use seat->mouse_focus, not seat->kbd_focus.
To enable this, break out key press/release handling code to a
separate function that takes an explicit term argument. Call this
function from keyboard_key(), input_repeat() and in alternate scroll
mode.
Closes#179
These bindings copy from the clipboard or primary selection into the
search buffer.
Default bindings:
* clipboard-paste: ctrl+v, ctrl+y
* primary-paste: shift+insert
The intention here is to make *all* text_from_clipboard() and
text_from_primary() callers benefit from mime-type base
decoding (e.g. URI list decoding).
Previously, the decoding was done *in* the callback, which meant only
the “default” clipboard/primary selection paste functions, and DnD,
recognized URI lists.
At the end of a drag-and-drop operation, we need to call
`wl_data_offer_finish()`.
We *must* ensure the data offer hasn’t been destroyed before
that. This could previously happen if the compositor decided to send a
regular clipboard offer *after* we had started a drop operation,
but *before* it had finished. The dnd offer was then destroyed when
the clipboard offer was received, causing us to crash in
`wl_data_offer_finish()`.
To handle this, let the receive_offer_context take over ownership of
the data_offer pointer, and “manually” destroy it *after* calling
`wl_data_offer_finish()` in `receive_dnd_done()`.
Note: we should not, and can not, do the same thing for regular
clipboard and primary selection offers; such offers can be used
multiple times and should *not* be destroyed after a single copy
operation.
On some platforms, TIOCSWINSZ has a very large value, >
0x80000000.
On some platforms, the `request` argument to `ioctl(3)` is an `int`.
For platforms where both of the above is true, gcc will warn (and
error out if compiled with `-Werror`) on:
ioctl(fd, TIOCSWINSZ, ...)
To silence this warning, we need to cast `TIOCSWINSZ` to an
integer.
However, doing this on platforms where `request` is an `unsigned long`
will result in `TIOCSWINSZ` being sign-extended (and thus we end up
with an invalid value).
It seems that casting to `unsigned int` works in both cases; it
silences the long -> int conversion warning, while also preserving the
correct value in all cases.
Add support for `text/plain`, `text/plain;charset=utf-8` and
`text/uri-list` to regular copy operations (both from clipboard and
primary selection) and drag-and-drop operations.
We accept COPY and MOVE actions, for text/plain;charset=utf-8
mime-types.
To implement DnD, we need to track the current DnD data offer *and*
the terminal instance it is (currently) targeting.
To do this, a seat has a new member, ‘dnd_term’. On a DnD enter event,
we lookup the corresponding terminal instance and point ‘dnd_term’ to
it.
On a DnD leave event, ‘dnd_term’ is reset.
The DnD data offer is tracked in the terminal’s wayland window
instance. It is reset, along with the seat’s ‘dnd_term’ on a DnD leave
event.
On a drop event, we immediately clear the seat’s ‘dnd_term’, to ensure
we don’t reset it, or destroy the offer before the drop has been
completed.
The drop’s ‘done()’ callback takes care of destroying and resetting
the DnD offer in the terminal’s wayland window instance.
Closes#175
These options lets the user configure custom fonts and styles, to use
with the bold and italic cell attributes.
By default, they are unset, meaning we use the bold/italic variants of
the regular font.
Closes#169.
* Don’t de-reference the xkb context/keymap/state if we failed to
instantiate them.
* Don’t try to send a translated utf8 key sequence if the translation
failed.
* Handle xkb_compose_state_get_utf8() and xkb_state_key_get_utf8()
returning more than 64 bytes.
This _may_ fix#171.