Daniel Eklöf
ac42ce4303
Merge branch 'pipe-grid-to-external-tool'
...
Closes https://codeberg.org/dnkl/foot/issues/29
2020-07-17 09:34:51 +02:00
Daniel Eklöf
47e8c337dc
Merge branch 'master' into pipe-grid-to-external-tool
2020-07-16 17:50:34 +02:00
Daniel Eklöf
067cf6ccb1
wayland: don't assume data-device globals are added before seats
...
When we're handling the initial set of globals, the data-device and
primary-selection-device objects may, or may not be registered before
the seat(s).
We need to handle both cases.
When adding a seat, instantiate the data-device and
primary-selection-device **if available**.
When adding the device objects, instantiate them on **all** currently
available seats.
2020-07-16 17:47:47 +02:00
Daniel Eklöf
e5401c845c
extract: finish: allocate buffer before writing the terminator
...
When all cells were empty, we'll have written 0 bytes to the buffer
and hence it will still be un-allocated (i.e. NULL).
2020-07-16 17:46:02 +02:00
Daniel Eklöf
e1e52c706a
term: remove unused struct definition 'rgb'
2020-07-16 11:52:51 +02:00
Daniel Eklöf
de75a2035e
Merge branch 'master' into pipe-grid-to-external-tool
2020-07-16 08:53:20 +02:00
Daniel Eklöf
7f6ed98a83
term: line-wrap: don't move cursor outside the grid
...
Remove assertion that row be less than the scrolling region end. The
cursor may in fact be *inside* the margin.
Inside the margin, content never scrolls, but we must make sure we
don't move the cursor outside the grid.
2020-07-16 08:47:37 +02:00
Daniel Eklöf
674f0dd0fc
sixel: verify list order: fix assertion when two sixels are on the same row
...
Two sixel may in fact exist on the same row, assuming their columns
don't overlap.
2020-07-16 08:13:44 +02:00
Daniel Eklöf
47d6dd0eee
csi: never call term_print() with width <= 0
2020-07-16 08:06:37 +02:00
Daniel Eklöf
6f2cffd8c0
vt: never call term_print() with a width <= 0
2020-07-16 08:04:12 +02:00
Daniel Eklöf
9508804b18
vt: ignore 0x7f (DEL) in ground state
...
This ensures *all* bytes mapped to action_print() have wcwidth == 1.
DEL has wcwidth == -1, and would thus have been ignored by
term_print() anwyway.
2020-07-16 08:01:37 +02:00
Daniel Eklöf
6183f7f64a
vt: utf8: handle multi-column spacer values correctly when combining
2020-07-16 07:41:51 +02:00
Daniel Eklöf
ad479cae05
changelog: use bemenu instead of fuzzel in pipe-visible example
2020-07-15 18:22:40 +02:00
Daniel Eklöf
22c73eaf4b
input: pipe-{visible,scrollback}: redirect stdout/stderr to /dev/null
2020-07-15 18:17:28 +02:00
Daniel Eklöf
765b714642
footrc: add pipe-visible and pipe-scrollback
2020-07-15 18:02:25 +02:00
Daniel Eklöf
8242ff5958
doc: foot.5: change pipe-visible example to use bemenu instead of fuzzel
2020-07-15 18:02:08 +02:00
Daniel Eklöf
e04b8f672b
changelog: minor
2020-07-15 17:54:25 +02:00
Daniel Eklöf
6ba6858fdc
changelog: document pipe-visible and pipe-scrollback bindings
2020-07-15 17:53:36 +02:00
Daniel Eklöf
48fa484f18
doc: foot.5: document pipe-visible and pipe-scrollback
2020-07-15 17:48:37 +02:00
Daniel Eklöf
94bb313282
config: oopsie, need to use strndup() on the pipe command
...
Since it isn't NULL-terminated.
2020-07-15 17:48:02 +02:00
Daniel Eklöf
65a46be822
config: change syntax for pipe-command in key binding
...
The pipe command can contain almost all printable characters. In
particular, we can expect it to contain '='.
Having the pipe command as part of the key breaks the key/value
splitting.
Change it so that it is instead an optional initial part of the value,
enclosed in '[]'.
I.e. instead of
pipe-visible:cmd=binding
we now need to write
pipe-visible=[cmd] binding
2020-07-15 17:28:09 +02:00
Daniel Eklöf
be9c566622
input: comments
2020-07-15 16:47:01 +02:00
Daniel Eklöf
1541531765
conf: bindings: allow several mappings for the same action
...
If the bindings has different pipe command associated with them, treat
them as different actions.
2020-07-15 16:43:11 +02:00
Daniel Eklöf
062b0eb7ab
input: wip: initial support for piping scrollback/view to external tools
2020-07-15 13:34:32 +02:00
Daniel Eklöf
69d9ff3f25
spawn: add optional stdin/stdout/stderr redirection FDs
...
If not -1, spawn() will redirect the child's stdin/stdout/stderr to
these FDs.
2020-07-15 13:33:56 +02:00
Daniel Eklöf
57f5cc1bf2
config: add support for appending a 'spawn' argument to key bindings
...
A key binding may now have an optional ':<cmd>' string appended to the
key.
This is intended to be used like so:
pipe-scrollback:sh -c "cat > file"=Print
TODO: we still only allow one *action*. Meaning you still cannot
specify multiple pipe-scrollback bindings, for example.
2020-07-15 13:32:31 +02:00
Daniel Eklöf
f21ea97037
input: parse_key_binding: free key-codes list if 'bindings' is NULL
2020-07-15 13:26:13 +02:00
Daniel Eklöf
9cdccdd2ac
term: break out fork+exec functionality to a separate file
2020-07-15 12:39:10 +02:00
Daniel Eklöf
9eb9a3d8a5
Merge pull request 'limit font size to non-negative values'
...
Closes https://codeberg.org/dnkl/foot/issues/38
2020-07-15 11:38:13 +02:00
Daniel Eklöf
4d17423ed1
term: add term_scrollback_to_text() and term_view_to_text()
...
These functions extract the current view, or the entire scrollback as
an UTF-8 encoded byte buffer.
2020-07-15 11:33:37 +02:00
Daniel Eklöf
e6acafa118
extract: extract_one() sets a fail flag that extract_finish() reads
...
This allows us to safely call extract_finish() when extract_one()
failed, and we'll get the expected result; false, indicating
extract_finish() failed.
2020-07-15 11:32:40 +02:00
Daniel Eklöf
ffaa19ee22
selection: provide a const-wrapper for extract_one()
...
extract_one() takes const pointers, while the callback argument to
foreach() expects non-const.
2020-07-15 11:31:57 +02:00
Daniel Eklöf
2539e3cbb2
extract: extract_one: make arguments const
2020-07-15 11:31:38 +02:00
Daniel Eklöf
aafa120f92
selection: refactor: break out text extraction to a separate file
2020-07-15 11:19:18 +02:00
Max Hollmann
5ae45c3b45
added font-size limitting to changelog
2020-07-15 11:05:22 +02:00
Max Hollmann
54e2b0b005
limit font size to non-negative values
2020-07-15 09:53:13 +02:00
Daniel Eklöf
85c50099af
conf: add definitions for pipe-{scrollback,view} bindings
2020-07-15 09:46:13 +02:00
Daniel Eklöf
22e7131241
Revert "wiki: testing"
...
This reverts commit b2dec8db16 .
2020-07-15 09:40:47 +02:00
Daniel Eklöf
b2dec8db16
wiki: testing
2020-07-15 09:35:20 +02:00
Daniel Eklöf
bead6f36d6
selection: don't skip SPACER cells in the generic foreach()
...
As that breaks e.g. selection marking (SPACER cells didn't get
inverted when rendered).
Instead, skip them in extract_one() only. I.e. when copying text from
the grid.
2020-07-15 09:22:06 +02:00
Daniel Eklöf
540864521e
selection: row->dirty is a boolean
2020-07-15 09:21:39 +02:00
Daniel Eklöf
970a42a6dd
term: don't re-render last cursor cell if cursor was hidden
2020-07-15 08:21:41 +02:00
Daniel Eklöf
6b0b3ddccc
Merge branch 'multi-column-special-spacer-value'
2020-07-15 08:20:10 +02:00
Daniel Eklöf
2fa2c9fad4
term: print: don't pad with spacers if auto-margin is disabled
2020-07-15 08:04:51 +02:00
Daniel Eklöf
b0798ad0be
grid: reflow: use macro print_spacer() to insert multi-column character spacers
2020-07-14 20:29:59 +02:00
Daniel Eklöf
f962fb236e
term: copy current VT attributes to multi-column spacer cells
...
And refactor: break out spacer-writing code to a function, since we do
exactly the same thing in two places.
2020-07-14 20:24:52 +02:00
Daniel Eklöf
a2af13a126
selection: no need to try to detect multi-column chars at the end of the line
...
This is handled by the generic foreach() functions, which now simply
skips spacer cells.
2020-07-14 17:06:04 +02:00
Daniel Eklöf
9ea42ef226
grid: reflow: handle multi column character spacers
...
Ignore *old* cells containing spacers.
Pad new grid with spacers if a multi-column character doesn't fit at
the end of a line.
Insert spacers after a multi-column character.
2020-07-14 17:04:59 +02:00
Daniel Eklöf
6d7aba3ea0
term: print: linewrap + insert *before* inserting SPACERS
...
Otherwise we end up overwriting the character in the last column
2020-07-14 17:03:20 +02:00
Daniel Eklöf
df2927e088
term: print: write special value CELL_MULT_COL_SPACER to extra cells
...
When printing a multi-column character, write CELL_MULT_COL_SPACER
instead of '0' to both padding cells (when character doesn't fit at
the end of the line), and to the cells following the actual character.
2020-07-14 16:49:11 +02:00