Commit graph

5189 commits

Author SHA1 Message Date
Daniel Eklöf
9f26b250bb
foot{,client}: handle argc == 0
Our getopt_long() based argument parser would (correctly) break out of
the while loop immediately. However, we would then proceed and
decrement ‘argc’ by 1, resulting in it being -1.

This was then passed to the terminal constructor, which passed it on
to the client application fork+exec logic. That finally resulted in an
exec(3) failure:

   err: slave.c:339: SHELL=/bin/zsh: failed to execute: No such file or directory
   err: fdm.c:215: no such FD: 7
  info: main.c:604: goodbye
2022-01-01 21:17:32 +01:00
Daniel Eklöf
b83daaac46
doc: ctlseq: add missing ‘[‘ to a couple of CSI sequences 2022-01-01 14:22:48 +01:00
Daniel Eklöf
8ffcd425e7
doc: ctlseq: kitty kbd: swap name/from 2022-01-01 14:15:21 +01:00
Daniel Eklöf
9af4b95234
doc: ctlseq: kitty keyboard protocol 2022-01-01 14:14:17 +01:00
Daniel Eklöf
2cae7d18b8
doc: ctlseq: private mode 1016 - SGR-Pixels 2022-01-01 14:01:15 +01:00
Daniel Eklöf
92dfab3bd1
Merge branch 'sgr-pixels'
Closes #762
2022-01-01 11:03:22 +01:00
Autumn Lamonte
d72ba4a062
SGR-Pixels mouse mode, closes #762 2022-01-01 11:02:30 +01:00
Daniel Eklöf
c0aa414404
test: config: colors: test ‘256’ is an invalid key 2021-12-30 21:49:08 +01:00
Daniel Eklöf
b7976e9565
test: config: test colors section 2021-12-29 19:54:21 +01:00
Daniel Eklöf
3583d1cd98
test: config: csd: test color options 2021-12-29 19:43:11 +01:00
Daniel Eklöf
7938b9e811
test: config: add test_color() utility function 2021-12-29 19:43:01 +01:00
Daniel Eklöf
a780a8b66f
test: config: test csd section 2021-12-29 19:33:18 +01:00
Daniel Eklöf
8b2e46b6dc
test: config: test mouse section 2021-12-29 19:18:41 +01:00
Daniel Eklöf
956f8995b9
test: config: test cursor section 2021-12-29 19:18:40 +01:00
Daniel Eklöf
58ce3b4a17
test: config: test URL section 2021-12-29 19:18:40 +01:00
Daniel Eklöf
8aa0ab0d9a
test: config: rename ‘conf_ptr’ -> ‘ptr’ 2021-12-29 19:10:37 +01:00
Daniel Eklöf
67edb43db4
test: config: scrollback: test indicator-positition 2021-12-29 19:04:19 +01:00
Daniel Eklöf
e058a43689
test: config: main: test dpi-aware, selection-target and initial-window-mode 2021-12-29 19:03:59 +01:00
Daniel Eklöf
a7c489980e
test: config: add test_enum() utility function 2021-12-29 19:03:36 +01:00
Daniel Eklöf
abec4f4e71
render: csd: scale border width when rendering the CSD border’s visible part 2021-12-29 18:11:51 +01:00
Daniel Eklöf
8ac2bcff67
render: limit the unfocused block cursor’s outline width
Ensure the outline width doesn’t exceed the cell width/height.
2021-12-29 18:05:00 +01:00
Daniel Eklöf
0a656d75d4
Merge branch 'scale-outline-of-unfocused-block-cursor' 2021-12-29 11:52:48 +01:00
Daniel Eklöf
ef8d5ebca0
render: scale the width out the outline of the unfocused block cursor 2021-12-28 20:57:24 +01:00
Daniel Eklöf
fa1088da93
Merge branch 'apply-scrollback-multiplier-in-alternate-scroll-mode' 2021-12-28 17:10:24 +01:00
Daniel Eklöf
c9086e6d4f
input: apply scrollback.multplier in alterate scroll mode
Before this patch, foot only applied [scrollback].multiplier on the
normal screen, never the alt screen.

However, scrolling can be done in two ways on the alt screen:

If the application has enabled mouse support, we simply pass on the
mouse scroll events to the application. Here, it makes sense to not
apply the multiplier, and instead let the application choose how much
to scroll for each scroll event.

But, if the application has not enabled mouse support, we can still
scroll by simulating the arrow keys being pressed - alternate
scrolling (private mode 1007).

This is enabled by default in foot (but can be disabled in foot.ini
with the [mouse].alternate-scroll-mode setting).

In this mode, it makes more sense to apply the multiplier. And that’s
what this patch changes - the multiplier is now applied, on the alt
screen, when the application has not enabled mouse support, and
alternate scrolling has been enabled in foot.

Closes #859
2021-12-28 17:10:03 +01:00
Daniel Eklöf
a835436537
term_mouse_grabbed(): make ‘seat’ argument const 2021-12-28 17:10:03 +01:00
Daniel Eklöf
1217cb50d2
changelog: irc+ircs added to default value of url.protocols 2021-12-27 21:13:26 +01:00
Daniel Eklöf
cbbc142eb9
Merge branch 'irc-url' 2021-12-27 21:12:17 +01:00
Simon Ser
3f34ec7470 Add irc:// to default URL schemes 2021-12-27 12:10:44 +01:00
Daniel Eklöf
3f10ee87b1
term: print: erase existing OSC-8 URI
If we have an “active” OSC-8 URI, term_print() would correctly replace
an existing URI with the new one.

But, if we don’t have an active URI, an existing URI was not
erased. This can be reproduced with e.g

  echo -e '\e]8;;http://foo.bar\e\\foobar\e]8;;\e\\\b\b\b\b\b😀\n'
2021-12-26 14:51:26 +01:00
Daniel Eklöf
4986df7eeb
test: config: fix format specifier: uint32_t needs %u, not %hu 2021-12-26 13:03:45 +01:00
Daniel Eklöf
323f645bb2
Merge branch 'term-erase-refactor' 2021-12-26 12:42:05 +01:00
Daniel Eklöf
39bb6be8bf
term_erase(): replace coord-typed arguments with regular ints 2021-12-26 12:39:34 +01:00
Daniel Eklöf
366da7349c
Merge branch 'cell-colors-use-index' 2021-12-26 12:39:01 +01:00
Daniel Eklöf
b218b8cfb0
sixel: VT state’s bg color may now be an index, rather than an actual color value 2021-12-26 12:37:48 +01:00
Daniel Eklöf
c2bf2d3650
csi: store color index, not actual color, in cell’s fg/bg attributes
When using indexed colors (i.e. SGR 30/40/90/100), store the index
into the cell’s fg/bg attributes, not the actual color value.

This has a couple of consequences:

Color table lookup is now done when rendering. This means a rendered
cell will always reflect the *current* color table, not the color
table that was in use when the cell was printed to.

This simplifies the OSC-4/104 logic, since we no longer need to update
the grid - we just have to damage it to trigger rendering.

Furthermore, this change simplifies the VT parsing, since we no longer
need to do any memory loads (except loading the SGR parameter values),
only writes.
2021-12-26 12:37:48 +01:00
Daniel Eklöf
8bf757f466
csi: no need to set VT state’s fg/bg to the default ones on SGR reset 2021-12-26 12:37:47 +01:00
Daniel Eklöf
2fa29fb5f4
test: config: test ‘scrollback’ section 2021-12-26 12:37:12 +01:00
Daniel Eklöf
cd9b936003
test: config: add test_double() utility function 2021-12-26 12:36:55 +01:00
Daniel Eklöf
193c696d03
test: config: add test_uint32() utility function 2021-12-26 12:36:43 +01:00
Daniel Eklöf
a3dc0d287d
config: update most parse_section_*() functions to return in each if-branch 2021-12-25 23:51:02 +01:00
Daniel Eklöf
8771bb20bf
config: scrollback: add missing return for ‘lines’
The missing return meant failures were not reported correctly.
2021-12-25 23:48:05 +01:00
Daniel Eklöf
c765d6722c
test: config: bindings: verify pipe argv 2021-12-25 23:37:04 +01:00
Daniel Eklöf
2c4e6680aa
test: config: test [bell].command (spawn template) 2021-12-25 23:33:39 +01:00
Daniel Eklöf
a4af00bd8b
test: config: test [main].notify (spawn template) 2021-12-25 23:33:39 +01:00
Daniel Eklöf
46eea75614
test: config: add test_spawn_template() utility function 2021-12-25 23:33:38 +01:00
Daniel Eklöf
e225be1c50
tokenize: free content of argv on failure, and reset the argv pointer
This fixes a memory leak when we failed to parse a command line (for
example, because it contained an unclosed quote).
2021-12-25 23:25:30 +01:00
Daniel Eklöf
ba851c963e
test: config: ‘bell’ section 2021-12-25 23:03:11 +01:00
Daniel Eklöf
a93e7867ff
changelog: grammar 2021-12-23 14:09:48 +01:00
Daniel Eklöf
a20e424dc0
Merge branch 'crash-on-csd-size-1'
Closes #857
2021-12-23 11:54:50 +01:00