Commit graph

3866 commits

Author SHA1 Message Date
Daniel Eklöf
ed47a65afc
csi: remove extra ‘;’ 2021-02-26 09:25:17 +01:00
Daniel Eklöf
c0be074348
doc: use ‘fuzzel’ instead of ‘bemenu’ in examples 2021-02-26 09:24:40 +01:00
Daniel Eklöf
44d9b7c74f
Merge branch 'url-mode-snapshot-screen-state' 2021-02-26 09:16:09 +01:00
Daniel Eklöf
ae0f20a536
url-mode: damage current view before entering URL mode
Clear scroll damage and damage the entire viewport before entering URL
mode. This will cause us to do a full screen redraw both when entering
URL mode, and later when exiting it.

Clearing the scroll damage is necessary to ensure we don’t apply it
twice (once for the snapshot:ed grid, and later again for the real
grid), as that would result in an incorrect pixmap.

But, since we’ve cleared the scroll damage, we need to damage the
entire view to ensure we redraw the contents correctly.
2021-02-26 09:15:46 +01:00
Daniel Eklöf
3c123425fb
command: scrollback: don’t allow scrolling in URL mode 2021-02-26 09:15:46 +01:00
Daniel Eklöf
bc71e06d5f
url-mode: dirty the “last cursor” cell before taking the snapshot
This ensures the “last cursor” cell is re-drawn (without a cursor, if
the cursor has moved), both in the snapshot:ed grid, and later, when
we switch back to the real grid.

We must also be careful and reset term->render.last_cursor.row
both when *entering* and *leaving* URL mode, to ensure it doesn’t
point to an invalid row.
2021-02-26 09:15:45 +01:00
Daniel Eklöf
aa10cd54ea
url-mode: no need to damage the entire view when exiting URL mode
The renderer will simply apply *all* accumulated damage at once, when
we render the real grid.
2021-02-26 09:15:45 +01:00
Daniel Eklöf
a0f021b7db
grid: snapshot: copy scroll damage 2021-02-26 09:15:45 +01:00
Daniel Eklöf
2cb624ee43
grid: grid_free(): free scroll damage list 2021-02-26 09:15:45 +01:00
Daniel Eklöf
54b5ae95c1
url-mode: snapshot screen state when entering URL mode
Previously, we automatically exited URL mode whenever we received data
on the PTY. This was done since we don’t know _what_ has changed on
the screen, and we don’t want to display misleading jump labels.

However, this becomes a problem in curses-like applications that
periodically updates part of the screen. For example, a statusbar with
a clock.

This patch changes this behavior; instead of cancelling URL mode when
receiving PTY data, we snapshot the grid when entering URL mode.

When *rendering*, we use the snapshot:ed grid, while PTY updates
modify the “real” grid.

Snapshot:ing the grid means taking a full/deep copy of the current
grid, including sixel images etc.

Finally, it isn’t necessary to “damage” the entire view
when *entering* URL mode, since we’re at that point the renderer is in
sync with the grid. But we *do* need to damage the entire view when
exiting URL mode, since the grid changes on the “real” grid hasn’t
been tracked by the renderer.
2021-02-26 09:15:45 +01:00
Daniel Eklöf
ae3ec52507
grid: add grid_snapshot()
This function deep copies a grid into a newly *allocated* grid struct.
2021-02-26 09:15:45 +01:00
Daniel Eklöf
bb74fe3f7d
grid: add grid_free() 2021-02-26 09:15:45 +01:00
Daniel Eklöf
ebf8070244
Merge branch 'url-launcher-redirect-stdout-stderr' 2021-02-26 09:15:16 +01:00
Daniel Eklöf
4e57711012
spawn: call setsid() in child process 2021-02-25 21:09:59 +01:00
Daniel Eklöf
8ffa0f731b
grid: reflow_uri_ranges(): URI end point is *inclusive*
Which means, when we match URI start and end points against the
current column index, we must *not* use ‘if...else if’, but two
‘if... if’.

Fixes an assertion when resizing a window with an URI range of just
one cell.
2021-02-25 20:54:05 +01:00
Daniel Eklöf
3149ef16c3
wayland: rename variable ‘main’ to ‘main_surface’
Some compilers don’t think we know what we’re doing:

  ../wayland.c:1554:24: error: ‘main’ is usually a function
2021-02-25 07:46:21 +01:00
Daniel Eklöf
8365fde980
url-mode: redirect stdin/stdout/stderr to /dev/null when opening an URL
This fixex an issue where TUI programs started in the parent
terminal (when running nested terminals).
2021-02-24 21:30:58 +01:00
Daniel Eklöf
9cb8f6e3b7
spawn: handle custom stdin/stdout/stderr fds being the same
Allow the caller to pass the same FD (for example, a single /dev/null
FD) to spawn().

All we need to do to handle this correctly is ensure we don’t try to
close the same FD multiple times.
2021-02-24 21:29:34 +01:00
Craig Barnes
b1385f6439 changelog: change "control- and escape sequences" to "escape sequences"
According to the way ECMA-48 defines these terms, "escape sequences"
are a superset of "control sequences", so there's no real reason to
mention both.
2021-02-23 19:58:26 +00:00
Craig Barnes
0da0532432 changelog: fix a typo 2021-02-23 19:57:34 +00:00
Daniel Eklöf
f3e081ad0a
changelog: add missing space character 2021-02-23 20:02:40 +01:00
Daniel Eklöf
c4ad12c1d8
changelog: added man page foot-ctlseq.7 2021-02-23 20:02:06 +01:00
Daniel Eklöf
0245d29827
Merge remote-tracking branch 'origin/foot-ctlseqs.7' 2021-02-23 19:59:14 +01:00
Craig Barnes
9b208f56de doc: ctlseqs: rename "foot-ctlseqs.5" man page to "foot-ctlseqs.7"
Section 5 is for "file formats and conventions", which doesn't really
apply to terminal escape sequences. Section 7 is for "miscellaneous".
2021-02-23 18:49:57 +00:00
Daniel Eklöf
3577f68d5a
Merge branch 'erase-uri-ranges-when-erasing-cells' 2021-02-23 18:47:20 +01:00
Daniel Eklöf
d81439e2f1
terminal: erase_cell_range: erase URI ranges affected by the erase.
* Partially affected URI ranges are split up
* Completely covered URI ranges are removed
2021-02-23 15:10:40 +01:00
Daniel Eklöf
7ee5247525
url-mode: disable debug logging 2021-02-23 14:59:54 +01:00
Daniel Eklöf
703d23f066
terminal: change type from uint32_t to bool in xtsave bitfield 2021-02-23 14:20:59 +01:00
Daniel Eklöf
39fe6fe8e1
Merge branch 'sixel-private-mode-8452'
Closes #363
2021-02-23 10:36:22 +01:00
Daniel Eklöf
03c675c6e2
sixel: implement private mode 8452 - cursor positioning after sixel
When disabled (the default), the cursor is positioned on a new line
after emitting a sixel image.

When enabled, the cursor is positioned to the right of the sixel
image.

Closes #363
2021-02-23 10:36:02 +01:00
Daniel Eklöf
9666d1d0b7
Merge branch 'sixel-private-color-registers'
Closes #362
2021-02-23 10:34:44 +01:00
Daniel Eklöf
667b3e9a1a
doc: ctlseq: add private mode 1070 - use private color registers for each sixel 2021-02-23 09:42:14 +01:00
Daniel Eklöf
8c44b63938
sixel: free private color registers on unhook 2021-02-23 09:40:22 +01:00
Daniel Eklöf
4aa980a6a2
sixel: implement private mode 1070 - private color palette
When enabled (the default), sixels use private color registers. That
is, the color palette from the last sixel is *not* re-used.

When disabled, sixels share (i.e. re-use) the same color palette.

Closes #362
2021-02-23 09:40:22 +01:00
Daniel Eklöf
313431800e
Merge branch 'document-control-sequences'
Closes #235
2021-02-23 09:32:04 +01:00
Daniel Eklöf
f08b05e796
doc: ctlseq: replace ‘ST’ with the actual characters, ‘\E\’ 2021-02-23 09:31:46 +01:00
Daniel Eklöf
8a3537b940
doc: ctlseq: re-phrase when DCS is used instead of \EP 2021-02-23 09:31:46 +01:00
Daniel Eklöf
2c0f391e3b
doc: ctlseq: add OSC-8 2021-02-23 09:31:46 +01:00
Daniel Eklöf
022646f8eb
doc: ctlseq: add missing ‘[’ in example escape sequence 2021-02-23 09:31:46 +01:00
Daniel Eklöf
db9bd8c1ae
doc: ctlseq: remove excessive highlighting 2021-02-23 09:31:46 +01:00
Daniel Eklöf
76721aaef3
doc: ctlseq: turn “CC1 - 8-bit control sequences” into a footnote
* 8-bit control characters are virtually never used. Many terminals do
  not support them. As such, there is no need to draw attention to the
  fact that foot does not implement them.
* Rename the “CC0 - 7-bit control characters” section to “Control
  characters”.
2021-02-23 09:31:46 +01:00
Daniel Eklöf
6e0eb904b7
doc: ctlseq: “7-bit control sequences” -> “7-bit control *characters*” 2021-02-23 09:31:45 +01:00
Daniel Eklöf
34363b6d24
doc: ctlseq: add CSI sub headers to index 2021-02-23 09:31:45 +01:00
Daniel Eklöf
451b3c53de
doc: ctlseq: add XTSMGRAPHICS 2021-02-23 09:31:45 +01:00
Daniel Eklöf
54d1421782
doc: ctlseq: document window manipulation sequences (CSI Ps;Ps;Ps t) 2021-02-23 09:31:45 +01:00
Daniel Eklöf
36f8cf0043
doc: ctlseq: don’t highlight literal characters, only parameters 2021-02-23 09:31:45 +01:00
Daniel Eklöf
0a33ce3e78
doc: ctlseq: sort “misc” CSI sequences 2021-02-23 09:31:45 +01:00
Daniel Eklöf
3c69a9c7e1
doc: ctlseq: add most of the remaining CSIs 2021-02-23 09:31:45 +01:00
Daniel Eklöf
a6e496ebca
doc: ctlseq: add ESC prefixed sequences 2021-02-23 09:31:45 +01:00
Daniel Eklöf
5539a7a02c
doc: ctlseq: add ‘origin’ column to OSC escape table 2021-02-23 09:31:45 +01:00