Commit graph

4374 commits

Author SHA1 Message Date
Craig Barnes
e030a2ca08 terminal: add 'charset_designator' enum to make code more self-documenting
This commit also renames the term_set_single_shift_ascii_printer()
function to term_single_shift(), since the former is overly verbose
and not really even accurate.
2021-06-09 10:00:25 +01:00
Craig Barnes
3c609771c5 changelog: add issue links for previous 2 entries 2021-06-09 09:30:34 +01:00
Craig Barnes
a2c9c56f19 vt: fix SS2/SS3 escape sequences to act correctly as single shifts
These sequences are supposed to affect the next printable ASCII
character and then reset to the previous character set, but before
this commit they were behaving like locking shifts.
2021-06-08 21:09:40 +01:00
Craig Barnes
e72e8b1b8e vt: add support for LS2 and LS3 locking shifts 2021-06-08 21:06:18 +01:00
Daniel Eklöf
e77b7d7111
Merge branch 'il-dl-reset-cursor-col' 2021-06-08 19:52:40 +02:00
Daniel Eklöf
0febce9007
csi: IL+DL: move cursor to column 0
This fixes vttest 11.6.6.3

Test non-VT100 ->
Test ISO-6429 colors ->
Test of VT102-style features with BCE ->
Test Insert/Delete Char/Line
2021-06-08 19:52:35 +02:00
Daniel Eklöf
a2f54c810b
Merge branch 'reverse-video-only-affects-default-fg-bg' 2021-06-08 19:52:13 +02:00
Daniel Eklöf
39560a6ff1
render: reverse video only swaps *default* fg/bg
This matches XTerm behavior, and fixes vttest 11.6.6.2:

Test non-VT100 ->
Test ISO-6429 colors ->
Test of VT102-style features with BCE ->
Test of screen features
2021-06-08 19:51:13 +02:00
Craig Barnes
620fe8e764 vt: fix buggy chains of ternary expressions in action_esc_dispatch()
Only the first character in the chain was being compared with `priv`
and the rest were just being evaluated as simple expressions. This
was causing the G2 and G3 operations to erroneously use the G1 index.

Since the characters are a contiguous range, we can just subtract the
start of the range to get the appropriate index. The outer switch
statement already ensures the values are in range.
2021-06-08 16:52:00 +01:00
Craig Barnes
b34d76f711 terminal: fix compilation error when debug logging is enabled
Without this fix, setting LOG_ENABLE_DBG to 1 in terminal.c would
cause the following error:

> terminal.c:1787: 'struct terminal' has no member named 'font_scale'

The 'font_scale' member was removed in commit
2afc678236.
2021-06-08 13:10:46 +01:00
Daniel Eklöf
95c4a8ccfb
vt: \E#8: print ‘E’ using the default attributes 2021-06-07 21:35:17 +02:00
Daniel Eklöf
0de55182ac
selection: reset ‘empty_count’ after we’ve emitted the empty cells
When marking and unmarking cells, we don’t highlight trailing empty
cells. We do however highlight empty cells if they are followed by
non-empty cells.

I think this was an intentional choice. If one row ended with trailing
empty cells, but *no* hard linebreak, then we’d continue on the next
row, and emit all the empty cells once we hit a non-emtpy cell on the
second row.

But this is something that shouldn’t happen in any real-world use
cases.
2021-06-05 13:41:17 +02:00
Daniel Eklöf
dfbe8297f7
Merge branch 'scrollback-key-bindings-pass-through-alt-screen'
Closes #573
2021-06-05 10:33:55 +02:00
Daniel Eklöf
a7e2e4bfa9
input: pass through scrollback-* key bindings when alt screen is activw
Since the alt screen have no scrollback, all scrollback-* actions are
effectively no-ops when the alt screen is active.

Make them available to the client application instead.

Closes #573
2021-06-04 23:25:45 +02:00
Daniel Eklöf
b5515a414a
Merge branch 'osc-9' 2021-06-04 07:44:07 +02:00
Daniel Eklöf
405b887a82
osc: implement iTerm2’s OSC-9 - desktop notifications 2021-06-04 07:44:00 +02:00
Daniel Eklöf
dd43afd754
Merge branch 'chunked-reflow'
Closes #504
2021-06-04 07:43:18 +02:00
Daniel Eklöf
354de2b8ee
changelog: text reflow performance 2021-06-04 07:42:53 +02:00
Daniel Eklöf
3292bb5b8e
grid: reflow: ‘amount’ has already been added to ‘from’ 2021-06-02 20:13:52 +02:00
Daniel Eklöf
cb83d60089
selection: fix bad assertion
When there are multiple multi-column characters back-to-back, the cell
before the pivot end point may in fact be a SPACER+1 cell.
2021-06-02 20:13:52 +02:00
Daniel Eklöf
a003e56fdc
grid: reflow: URI range start: take over ownership of URI string
Instead of strdup:ing the URI, take over ownership. This is ok since
the old URI range will be free:d anyway.
2021-06-02 20:13:52 +02:00
Daniel Eklöf
8a9643de67
grid: reflow: debug logging 2021-06-02 20:13:51 +02:00
Daniel Eklöf
ceab9b9367
grid: reflow: when determining row end coord, check *last* URI range 2021-06-02 20:13:51 +02:00
Daniel Eklöf
5a08ed641b
grid: reflow: when determining row end coord, check *last* tracking point 2021-06-02 20:13:51 +02:00
Daniel Eklöf
ef1fdc40c8
grid: reflow: check the *entire* row for non-empty cells 2021-06-02 20:13:51 +02:00
Daniel Eklöf
c2314d689e
grid: reflow: avoid unnecessary if-statements before chunking a row 2021-06-02 20:13:51 +02:00
Daniel Eklöf
2029d201b5
grid: disable reflow timing by default 2021-06-02 20:13:51 +02:00
Daniel Eklöf
ac97f20f99
grid: reflow: comments 2021-06-02 20:13:51 +02:00
Daniel Eklöf
5325ea042d
grid: no need to keep the tp_col/uri_col variables around 2021-06-02 20:13:51 +02:00
Daniel Eklöf
3453f091a3
grid: fix col max calculation when row contains URI ranges 2021-06-02 20:13:51 +02:00
Daniel Eklöf
a56b54ad2f
grid: set tp/uri break flags explicitly when we know them to be true 2021-06-02 20:13:51 +02:00
Daniel Eklöf
4b7e4fb885
grid: reflow: slightly simplified logic for end-coordinate calculation 2021-06-02 20:13:51 +02:00
Daniel Eklöf
315865f18c
grid: reflow: rename _range -> range 2021-06-02 20:13:51 +02:00
Daniel Eklöf
7c3a4b24d9
grid: reflow: remove dead code 2021-06-02 20:13:50 +02:00
Daniel Eklöf
40ca86b2d3
grid: reflow: memcpy() chunks of cells, instead of single cell-by-cell
Instead of walking the old grid cell-by-cell, and checking for
tracking points, OSC-8 URIs etc on each cell, memcpy() sequences of
cells.

For each row, find the end column, by scanning backward, looking for
the first non-empty cell.

Chunk the row based on tracking point coordinates. If there aren’t any
tracking coordinates, or OSC-8 URIs on the current row, the entire row
is copied in one go.

The chunk of cells is copied to the new grid. We may have to split it
up into multiple copies, since not all cells may fit on the current
“new” row.

Care must also be taken to not line break in the middle of a
multi-column character.
2021-06-02 20:13:50 +02:00
Daniel Eklöf
6671d53859
Merge branch 'restore-sighup-handler' 2021-06-02 20:13:26 +02:00
Daniel Eklöf
a72b2688bd
slave/spawn: restore SIGHUP handler after fork(), before exec()
Foot installs a SIG_IGN handler for SIGHUP. Ignored signals are
inherited in sub-processes. Thus, we need to restore it to SIG_DFL
before exec:ing.
2021-06-02 20:13:14 +02:00
Daniel Eklöf
2f7e5aed40
Merge branch 'dont-split-multi-column-chars-when-resizing-alt-screen' 2021-06-02 20:12:01 +02:00
Daniel Eklöf
b7709cc013
grid: don’t cut multi-column chars in half when resizing the alt screen
When we resize the alt screen, we don’t reflow the text, we simply
truncate all the lines.

When doing this, make sure we don’t truncate in the middle of a
multi-column character.
2021-06-02 19:32:05 +02:00
Daniel Eklöf
363aeea2df
Merge branch 'url-mode-off-by-one' 2021-06-02 08:11:20 +02:00
Daniel Eklöf
974c3acd78
url-mode: off-by-one error in end-point column of auto-detected URLs
When an auto-detected URL ended *on* the right-most column, the URL
endpoint was off by one, resulting in the underline in URL mode being
one character short.
2021-06-02 08:11:14 +02:00
Daniel Eklöf
19429d13a3
Merge branch 'document-terminfo'
Closes #549
2021-06-02 08:10:19 +02:00
Daniel Eklöf
2ffedc7082
doc: foot{,client}: updates from feedback from @craigbarnes 2021-06-02 08:10:02 +02:00
Daniel Eklöf
1321b23567
doc: footclient.1: -t,--term: add references to ENVIRONMENT and TERMINFO sections 2021-06-02 08:10:02 +02:00
Daniel Eklöf
a1a521b81d
doc: footclient.1: add TERMINFO section 2021-06-02 08:10:02 +02:00
Daniel Eklöf
d6715625e2
doc: foot.1: -t,--term: add references to ENVIRONMENT and TERMINFO sections 2021-06-02 08:10:02 +02:00
Daniel Eklöf
dde31ffaf9
doc: foot.1: add TERMINFO section 2021-06-02 08:09:52 +02:00
Daniel Eklöf
f74c5fa9f0
Merge branch 'pua-double-width' 2021-06-01 17:51:25 +02:00
Daniel Eklöf
4c954be7a6
config: add boolean option tweak.pua-double-width
When enabled, PUA (Private Usage Area) codepoints are always treated
as double-width glyphs, regardless of the actual glyph width.

Requires allow-overflowing-double-width-glyphs=yes
2021-06-01 17:51:09 +02:00
Daniel Eklöf
d458d46f81
Merge branch 'selection-recognizes-hard-linebreaks'
Closes #565
2021-06-01 17:50:24 +02:00