Commit graph

3884 commits

Author SHA1 Message Date
Daniel Eklöf
544cd823d7
Merge branch 'ime-dont-commit-unless-we-have-ime-focus'
Closes #384
2021-03-04 09:29:36 +01:00
Daniel Eklöf
e9d8ade5cc
input: mutter has been seen sending NULL surfaces in pointer enter 2021-03-04 08:57:31 +01:00
Daniel Eklöf
81b5d476a9
input: exit URLs mode on mouse button events
This makes URLs mode behave like scrollback search mode.
2021-03-04 08:57:03 +01:00
Daniel Eklöf
31a3b7dadf
render: jump-labels: case insensitive comparison when looking for matching keys 2021-03-04 08:55:55 +01:00
Daniel Eklöf
e5cd09bf3f
url-mode: ignore keys with modifiers 2021-03-04 08:54:38 +01:00
Daniel Eklöf
6654aab620
changelog: oops, vertical-letter-offset is new in 1.7.x
No need to a changelog entry for fixing something that hasn’t yet been
released.
2021-03-02 09:25:06 +01:00
Daniel Eklöf
55e3c74903
Merge branch 'fix-vertical-letter-offset-config' 2021-03-02 09:22:59 +01:00
Daniel Eklöf
3f19ee4d92
ime: don’t commit IME changes when we don’t have IME focus
Fixes log spamming in Sway:

  00:54:07.780 [DEBUG] [wlr] [types/wlr_text_input_v3.c:181] Text input commit received without focus
  00:54:07.780 [INFO] [sway/input/text_input.c:127] Inactive text input tried to commit an update

Closes #384
2021-03-02 09:01:40 +01:00
L3MON4D3
6edba44651 Mention fix in Changelog. 2021-03-01 20:26:56 +01:00
Daniel Eklöf
c3880af593
Merge branch 'add-name-section-to-foot-ctlseq' 2021-03-01 19:59:10 +01:00
L3MON4D3
093df837ca Fix typo. 2021-03-01 13:44:46 +01:00
Felix Lechner
e54abd1c33 Add NAME section to foot-ctlseqs.7; fixes whatis entry for manual page.
In a recent Debian build from master, Lintian complained about a bad
whatis entry for this manual page. The tag description [1] says a NAME
section is required. It is added here.

[1] https://lintian.debian.org/tags/bad-whatis-entry.html
2021-02-28 09:52:53 -08:00
Daniel Eklöf
3f57cc9c01
Merge branch 'sixel-private-mode-80-scrolling'
Closes #361
2021-02-27 11:49:47 +01:00
Daniel Eklöf
dd73964cd5
changelog: default value of -t,--term in --help when built without terminfo 2021-02-26 15:16:42 +01:00
Chloe Kudryavtsev
80b95eeb7e
config: reuse HAVE_TERMINFO via DEFAULT_TERM
add detection in --help output
also make it more easily accessible for other locations to change
2021-02-26 15:15:05 +01:00
Daniel Eklöf
1563fecc20
sixel: don’t go past the bottom scroll margin when sixel scrolling is disabled
When sixel scrolling is disabled (private mode 80 is off), and scroll
margins have been set, XTerm seems to ignore the top margin (sixel
still begins at (0,0)), but does not go past the bottom margin.

This patch implements the same behavior in foot.
2021-02-26 14:20:00 +01:00
Daniel Eklöf
849427bf10
sixel: implement private mode 80 - sixel scrolling
When enabled (the default), sixels behave much like normal output; the
start where the cursor is, and the cursor moves with the
sixel. I.e. after emitting a sixel the cursor is left after the image;
either to the right, if private mode 8452 is enabled, or otherwise on
the next line. Terminal content is scrolled up if the sixel is larger
than the screen.

When disabled, sixels *always* start at (0,0), the cursor never moves,
and the terminal content never scrolls.

In other words, the ‘disabled’ mode is a much simpler mode.

All we need to do to support both modes is re-write the sixel-emitting
loop to:

* break early if we’re “out of rows”, i.e. we’ve reached the bottom of
  the screen.
* not linefeed, or move the cursor when scrolling is disabled

This patch also fixes a bug in the (new) implementation of private
mode 8452.

When emitting a sixel, we may break it up into smaller pieces, to
ensure a single sixel (as tracked internally) does not cross the
scrollback wrap-around.

The code that checked if we should do a linefeed or not, would skip
the linefeed on the last row of *each* such sixel piece. The correct
thing to do is to skip it only on the last row of the *last* piece.

I chose not to fix this bug in a separate patch since doing so would
have meant re-writing it again when implementing private mode 80.
2021-02-26 09:28:03 +01:00
Daniel Eklöf
792202bf29
grid: snapshot: don’t mark all cells as dirty - copy state from source grid 2021-02-26 09:25:27 +01:00
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