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
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
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
Daniel Eklöf
5c99e8013b
term: rename COMB_CHARS_LO,HI -> CELL_COMB_CHARS_LO,HI
2020-07-14 16:41:57 +02:00
Daniel Eklöf
4cf7195695
selection: recognize empty padding cells in a forced linewrap
...
When printing a multi-column character at the end of the line, and it
doesn't fit, we currently insert a forced line-wrap. This means the
last character(s) on the previous line will be empty, followed by a
multi-column character in the first cell on the next line.
Without special code to handle this, the selection text extraction
code will insert a hard newline, since this is normally the correct
thing to do.
Add a TODO, to consider writing a special place holder value to these
padding cells.
2020-07-14 13:17:50 +02:00
Daniel Eklöf
3bc404b5a3
selection: foreach: don't call callback for trailing multi-character cells
2020-07-14 12:59:36 +02:00
Daniel Eklöf
7d134e6b1c
changelog: 'not' -> 'now'
2020-07-14 12:48:16 +02:00
Daniel Eklöf
3fd61fa120
grid: reflow: always emit *all* cells of a multi-column character
2020-07-14 12:15:25 +02:00
Daniel Eklöf
7480c1c06b
term: remove assert, as we're already checking for this in the loop condition
2020-07-14 12:07:12 +02:00
Daniel Eklöf
b035469a7f
term: print: manually increment cursor column
...
We know we're within bounds, and thus we don't need the extra overhead
of term_cursor_right().
2020-07-14 12:05:24 +02:00
Daniel Eklöf
466466c19e
grid: reflow: use width=1 for invalid characters
2020-07-14 12:03:10 +02:00
Daniel Eklöf
98ebb99be3
term: line-wrap: need to update grid->cur_row when we did *not* scroll
2020-07-14 12:01:00 +02:00
Daniel Eklöf
635698722e
changelog: prefix all C0 names with 'C0::'
2020-07-14 11:33:30 +02:00
Daniel Eklöf
6ea9d1246f
term: print: also require width > 1 when checking if we need to force-wrap or not
...
While this might seem like it would slow down things, it should in
fact help the compiler optimize: the "normal" code path, that prints
regular ASCII characters, always call term_print() with width == 1.
2020-07-14 11:26:14 +02:00
Daniel Eklöf
b8c7dfba5c
term: line-wrap: manually set cursor row+col
...
line-wrap is in the hot path, and term_cursor_down/left adds
additional checks that we don't need.
2020-07-14 11:25:06 +02:00
Daniel Eklöf
803c87bb65
grid: reflow: force line-wrap if a multi-column character does not fit on current line
2020-07-14 11:03:33 +02:00
Daniel Eklöf
9dc1d18241
term: print: force line-wrap if a multi-column character does not fit on current line
2020-07-14 10:58:57 +02:00
Daniel Eklöf
bc2fc778ae
csi: DECAWM: clear LCF
2020-07-14 10:54:53 +02:00
Daniel Eklöf
7fce1720d6
csi: IND+RI now clears LCF
2020-07-14 10:52:46 +02:00