Commit graph

3176 commits

Author SHA1 Message Date
Daniel Eklöf
098a7e42cb
meson/pkgbuild: bump version to 1.6.0 2020-12-18 14:52:10 +01:00
Daniel Eklöf
8cc179cc53
changelog: prepare for 1.6.0 2020-12-18 14:51:34 +01:00
Daniel Eklöf
59e4243f2a
changelog: move entry for dpi-aware up, to make it more visible 2020-12-18 14:46:56 +01:00
Daniel Eklöf
c1dc38e813
changelog: use code/monospace highlighting for foot.ini config options 2020-12-18 14:46:16 +01:00
Daniel Eklöf
5c59e38cf4
Merge branch 'dpi-aware-when-scaling-factor-is-one' 2020-12-18 14:42:48 +01:00
Daniel Eklöf
397154bd4e
Merge branch 'statusline-terminfo-caps'
Closes #242
2020-12-18 14:41:31 +01:00
Daniel Eklöf
fa93a97a08
terminfo: add status line capabilities: hs, dsl, fsl and tsl
* hs  - boolean, signals status line availability
* tsl - to_status_line: begin an OSC 2 sequence (set window title)
* fsl - from_status_line: OSC terminator
* dsl - disable status line: \E]2;\E\\ - clears the window title

Closes #242
2020-12-18 13:46:57 +01:00
Daniel Eklöf
34fe1e3f81
Merge branch 'gruvbox-light' 2020-12-17 12:37:23 +01:00
Daniel Eklöf
57e535908d
readme: describe the new font sizing behavior 2020-12-17 12:19:13 +01:00
Daniel Eklöf
0a821f2ed4
fonts: size fonts using the scaling factor when output scaling is enabled
This extends the new ‘dpi-aware’ option with a new default value,
‘auto’.

When set to ‘auto’, fonts are sized using monitors’ DPI when output
scaling is disabled. When output scaling is enabled, fonts are instead
sized using the scaling factor.

The reasoning here is that a user that has enabled output scaling is
obviously *not* relying on DPI scaling.

Output scaling can also be a way to compensate for different viewing
distances, in which case we do *not* want to break that by using DPI
scaling.

Users can still force DPI-only font sizing by setting ‘dpi-aware=yes’,
or disable it completely by setting ‘dpi-aware=no’.
2020-12-17 12:05:22 +01:00
AdrienLeGuillou
24131a896f Add a gruvebox-light theme 2020-12-17 09:25:53 +01:00
Daniel Eklöf
69cd5fd3ab
vt: codespell: ony -> only 2020-12-16 15:06:34 +01:00
Daniel Eklöf
2e137c0a7e
vt: don’t ignore extra private/intermediate characters
Take ‘\E(#0’ for example - this is *not* the same as ‘\E(0’.

Up until now, foot has however treated them as the same escape,
because the handler for ‘\E(0’ didn’t verify there weren’t any _other_
private characters present.

Fix this by turning the ‘private’ array into a single 4-byte
integer. This allows us to match *all* privates with a single
comparison.

Private characters are added to the LSB first, and MSB last. This
means we can check for single privates in pretty much the same way as
before:

  switch (term->vt.private) {
  case ‘?’:
      ...
      break;
  }

Checking for two (or more) is much uglier, but foot only supports
a *single* escape with two privates, and no escapes with three or
more:

  switch (term->vt.private) {
  case 0x243f:  /* ‘?$’ */
      ...
      break;
  }

The ‘clear’ action remains simple (and fast), with a single write
operation.

Collecting privates is potentially _slightly_ more complex than
before; we now need mask and compare, instead of simply comparing,
when checking how many privates we already have.

We _could_ add a counter, which would make collecting privates easier,
but this would add an additional write to the ‘clean’ action which is
really bad since it’s in the hot path.
2020-12-16 14:30:49 +01:00
Daniel Eklöf
db097891f2
csi: implement DECRQM (DEC modes), for real
Previously, we always returned ‘2 - reset’, instead of the actual
state of the requested mode.
2020-12-16 13:57:40 +01:00
Daniel Eklöf
37f036f9e9
changelog: ECMA-4*8* 2020-12-16 10:33:04 +01:00
Daniel Eklöf
066b2297ef
changelog: group ‘bell’ entries together 2020-12-16 10:32:21 +01:00
Daniel Eklöf
3744c09b35
readme: add link to IRC channel log 2020-12-16 10:31:09 +01:00
Daniel Eklöf
0d6b5f522e
config_font_parse(): return fail/success 2020-12-15 18:55:27 +01:00
Daniel Eklöf
04703c07f0
csi: SGR 21 is “double underline”, not “disable bold” (according to ECMA-48) 2020-12-14 19:10:30 +01:00
Daniel Eklöf
6c8b034aff
term: enabling application synchronized updates clear pending grid refresh
This fixes issues with de-synchronized frames being rendered; we may
have scheduled a redraw earlier, that hasn’t yet triggered (probably
because we’re waiting for a frame callback), when we enable
application synchronized updates.

This means we risk rendering a partially updated state when the frame
callback finally arrives, if the application hasn’t yet ended its
synchronized update.
2020-12-14 19:05:54 +01:00
Daniel Eklöf
602dbdb9f6
input: make sure ‘surf_kind’ is not uninitialized 2020-12-12 21:10:28 +01:00
Daniel Eklöf
9f321e6030
csi: fix sub-parameter versions of 38/48 SGR escapes
Well this is embarrassing; the sub-parameter versions of the 38/48 SGR
escapes all required an extra ‘:2’ that wasn’t supposed to be there,
causing all the other sub-parameters to be shifted one step to the
right.

That is, foot expected e.g. 38:2:2:r:g:b, or 38:2:5:idx when the
correct sequences are 38:2:cs:r:g:b and 38:5:idx.

I.e. I mixed up the color-space ID (cs) of 38:2 with *type* of color:
RGB or indexed.

In addition to fixing this, this patch also adds support for a
“bastard” version of the sub-parameter based RGB escapes, where the
color-space identifier has been left out: e.g. 38:2:r:g:b. This
sequence is invalid, but applications tend to “forget” the color-space
ID...
2020-12-12 20:55:31 +01:00
Daniel Eklöf
ff96ce1e91
input: rework mouse button/motion handling
Store a list of currently pressed buttons, and which surface they
belong to (i.e. which surface that received the press).

Then, in motion events (with a button pressed, aka drag operations),
send the event to the “original” surface (that received the press).

Also send release events to the originating surface.

This means a surface receiving a press will always receive a
corresponding release. And no one will receive a release event without
a corresponding press event.

Motion events with a button pressed will *always* use the *first*
button that was pressed. I.e. if you press a button, start dragging,
and then press another button, we keep generating motion events for
the *first* button.
2020-12-12 19:05:24 +01:00
Daniel Eklöf
a1a0b489ee
input: report mouse drag events also when the pointer is outside the grid
As long as the mouse button was *pressed* while the pointer was inside
the grid, we want to keep reporting motion events until the button is
released.

Even when the pointer moves outside the grid (but in this case, the
reported coordinates are bounded by the grid size).

This patch also tries to improve multi-button handling (i.e. multiple
buttons pressed at the same time), and the events we report to the
client for these, in the following ways:

* Motion events now report the *initial* button. That is, if you start
  a drag operation with the LEFT button, then press RIGHT (before
  releasing LEFT), keep reporting LEFT in the motion events.
* Mouse release events are reported for *any* button, as long as the
  pointer is *inside* the grid, *or*, the button released was the
  button used to start a drag operation.

The last point is important; if we have reported a button press
followed by motion events (i.e. a drag operation), we need to report
the button release, *even* if the pointer is outside the grid.

Note that the client may receive unbalanced button press/release
events in the following ways if the user pressed one, and then a
second button *inside* the grid, then releases the *first*
button (possibly outside the grid), and finally releases the *second*
button *outside* the grid.

In this case, both buttons will report press events. The first button
will report a release event since it is the initial button in the drag
operation.

However, we don’t track the fact that the second button is being
pressed, and thus if it is released outside the grid, it wont generate
a release event.
2020-12-11 21:01:00 +01:00
Daniel Eklöf
975e70dae1
csi: ‘CSI s’ and ‘CSI u’ now saves/restores attributes and charsets 2020-12-11 20:01:19 +01:00
Daniel Eklöf
934466bc84
Merge branch 'osc777-notify'
Closes #224
2020-12-11 19:44:32 +01:00
Daniel Eklöf
15d20af2a2
config: add ‘notify’ to possible values for ‘bell’ in foot.ini
When `bell=notify`, foot will trigger a desktop notification when it
receives a BEL in an unfocused window.
2020-12-10 18:22:48 +01:00
Daniel Eklöf
1d8410b7ae
notify: don’t emit notification when we’re focused 2020-12-10 18:07:50 +01:00
Daniel Eklöf
03cbb6ad90
notify: break out desktop notifications from osc.c 2020-12-10 18:06:24 +01:00
Daniel Eklöf
21cc68d49e
osc: implement urxvt’s “OSC 777;notify”
OSC 777 is URxvt’s generic escape to send commands to its perl
extensions. The first parameter is the name of the extension, followed
by its arguments.

OSC 777;notify is a, if not well established, at least a fairly well
known escape sequence to request a (desktop) notification. The syntax
is:

  \e]777;notify;<title>;<body>\e\\

Neither title nor body is escaped in any way, meaning they should not
contain a ‘;’.

Foot will split title from body at the *first* ‘;’. Any remaining ‘;’
characters are treated as part of ‘body’.

Instead of adding built-in support for the freedesktop notification
specification (which would require us to link against at least dbus),
add a new config option to foot.ini: ‘notify’.

This option specifies the command to execute when a notification is
received. ‘${title}’ and ‘${body}’ can be used anywhere, in any
combination, and as many times as you want, in any of the command
arguments.

The default value is ‘notify-send -a foot -i foot ${title} ${body}’
2020-12-09 20:54:51 +01:00
Daniel Eklöf
3e25faeae7
Merge branch 'remove-deprecated-things' 2020-12-09 20:53:05 +01:00
Daniel Eklöf
e42fd0f87f
changelog: don’t repeat ‘IME’ 2020-12-08 20:31:48 +01:00
Daniel Eklöf
3d14d79c01
changelog: add missing space in escape sequence 2020-12-08 20:31:22 +01:00
Daniel Eklöf
251026800f
changelog: consistently use ‘CSI ? X h/l’ instead of \E[?Xh/l 2020-12-08 20:29:44 +01:00
Daniel Eklöf
0263a152d4
Merge branch 'input-method-editor'
Closes #134
2020-12-08 20:06:22 +01:00
Daniel Eklöf
5020366bf5
config: remove support for scrollback-up and scrollback-down 2020-12-08 19:58:02 +01:00
Daniel Eklöf
386796cec6
config: remove support for default.geometry 2020-12-08 19:53:55 +01:00
Daniel Eklöf
6ec63eae00
config: remove support for default.scrollback 2020-12-08 19:52:28 +01:00
Daniel Eklöf
7b16802972
config: remove support for loading configuration from footrc 2020-12-08 19:52:22 +01:00
Daniel Eklöf
e7c56b0b29
completions: zsh: foot: fix default path of foot.ini 2020-12-08 19:49:14 +01:00
Daniel Eklöf
6494ba24c9
install: simplify sentence 2020-12-08 19:19:09 +01:00
Daniel Eklöf
ae01caee8c
render: ime: ensure cursor is visible 2020-12-08 19:17:46 +01:00
Daniel Eklöf
2ac520b958
changelog: DECSET 737769 - enable/disable IME 2020-12-07 20:44:15 +01:00
Daniel Eklöf
b270f221d0
render: search: render IME pre-edit text correctly, hopefully 2020-12-07 20:44:15 +01:00
Daniel Eklöf
a6ed9a9773
ime: don’t underline characters inside the cursor-box 2020-12-07 20:44:15 +01:00
Daniel Eklöf
fc2bcf9bc0
search: reset IME state when entering/exiting search mode 2020-12-07 20:44:15 +01:00
Daniel Eklöf
bcfc468fd0
render: ime: adjust cursor cell index when adjusting glyph offset 2020-12-07 20:44:15 +01:00
Daniel Eklöf
d46dcd8ef5
render: ime: wip: pre-edit 2020-12-07 20:44:14 +01:00
Daniel Eklöf
fd42a0bc23
ime: call render_refresh_search() instead of render_refresh()
When scrollback search is active
2020-12-07 20:44:14 +01:00
Daniel Eklöf
194fbff883
ime: store wchar version of pre-edit string in terminal struct 2020-12-07 20:44:14 +01:00