Commit graph

188 commits

Author SHA1 Message Date
Daniel Eklöf
b255aea3ed
config: free URL bindings 2021-02-07 16:33:31 +01:00
Daniel Eklöf
ee39966ded
config: add infrastructure to handle URL mode specific key bindings
* Add “show-urls” action to regular key bindings
* Add url-bindings section to foot.ini
* Add “cancel” action to URL mode key bindings
2021-02-07 16:33:31 +01:00
Daniel Eklöf
3a7588bc99
config: promote tweak.resize-delay-ms to a real, supported option 2021-01-26 19:32:21 +01:00
Daniel Eklöf
9a1df7bb03
render: delay TIOCSWINSZ while doing an interactive resize
Instead of disabling content centering, delay the TIOCSWINSZ (a.k.a
delay sending the new dimensions to the client) by a small amount
while doing an interactive resize.

Non-interactive resizes are still immediate.

For now, force a resize when the user stops the interactive
resize. This ensures the client application receives the new
dimensions immediately.

It still works without the last, forced, resize, but there typically
be a small delay until the client application receives the final
dimensions.

Closes #301
Closes #283
2021-01-26 19:32:06 +01:00
Daniel Eklöf
3d60600897
config: selection-target: space-optimize the static ‘value’ array 2021-01-23 10:44:19 +01:00
Daniel Eklöf
4f578189cc
config: add ‘none’ as a possible value for ‘selection-target’
When ‘selection-target’ is set to ‘none’, selecting text does not copy
the text to _any_ clipboard.

This patch also refactors the value parsing to be data driven.
2021-01-23 10:43:59 +01:00
Daniel Eklöf
e69ca255b0
config: add new option ‘selection-target’
This option controls the clipboard target that selected text should be
copied to.
2021-01-23 10:43:59 +01:00
Jan Beich
15f2bebdcb
meson: optionalize terminfo dependency
ncurses on FreeBSD still uses termcap(5) while foot works fine with
xterm-256color sans status line and visible bell. Having more than
one ncurses version installed may break other applications.

Document -Dterminfo=false uses --term=xterm-256color by default
2021-01-23 09:52:42 +01:00
Craig Barnes
e56136ce11 debug: rename assert() to xassert(), to avoid clashing with <assert.h> 2021-01-16 20:16:00 +00:00
Craig Barnes
22f25a9e4f Print stack trace on assert() failure or when calling fatal_error()
Note: this uses the __sanitizer_print_stack_trace() function from the
AddressSanitizer runtime, so it only works when AddressSanitizer is
in use.
2021-01-16 19:56:33 +00:00
Daniel Eklöf
767bd4f1db
config: add ‘select-extend-character-wise’ bind action
This forces the (new) selection mode to be character-wise when
extending a word- or line-wise selection.

Default key binding is ctrl+RMB.
2021-01-14 16:29:29 +01:00
Daniel Eklöf
f178de4c25
config: change default box drawing line thickness from 0.02 -> 0.04 2021-01-12 17:31:55 +01:00
Daniel Eklöf
cbe896f694
config: add temporary(?) tweak option for box drawing line thickness 2021-01-12 17:31:55 +01:00
Daniel Eklöf
dce402ae42
config: pt_or_px cannot be a union 2021-01-11 19:37:05 +01:00
Daniel Eklöf
a6fc8b5da4
config: line-height, letter-spacing: values are in pt by default, but we allow px
If the value is specified without a unit, then the value is assumed to
be in points, subject to DPI scaling.

The value can optionally have a ‘px’ suffix, in which case the value
is treated as a raw pixel count.
2021-01-11 09:31:08 +01:00
Daniel Eklöf
4c9f593d91
config: str_to_color(): use LOG_AND_NOTIFY(), not just LOG() 2021-01-11 09:31:08 +01:00
Daniel Eklöf
c2be3408ed
config; {horizontal,vertical}-letter-offsets may be negative 2021-01-11 09:31:07 +01:00
Daniel Eklöf
70cfcf11fb
config: letter-spacing: make this a relative value
0, the default, means no additional spacing; the cell width is defined
by the font metrics.

A positive value *adds* to the width from the font metrics, while a
negative value *subtracts*.
2021-01-11 09:31:06 +01:00
Daniel Eklöf
f9c9dd2432
config: add line-height, letter-spacing, {horizontal,vertical}-letter-offset 2021-01-11 09:31:05 +01:00
Daniel Eklöf
e14c592f39
config: add optional ‘center’ argument to ‘pad’
When set, the grid contents is centered in the window. I.e. the
left/right and top/bottom margins are equal (+- 1px).

This causes the content to “jump” while doing an interactive resize,
but may still be preferred in e.g. a tiling WM.

Closes #273
2021-01-06 11:17:29 +01:00
Peter Colberg
afc343d528 Require trailing comment to be preceded by a space or tab
Fixes `word-delimiters` option to not ignore `#` and subsequent characters.

Closes #270
2021-01-03 14:08:25 -05: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
Daniel Eklöf
0d6b5f522e
config_font_parse(): return fail/success 2020-12-15 18:55:27 +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
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
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
5e46672cf4
config: ignore “self” when detecting key binding collisions
Previously, foot would not accept the following:

  [key-bindings]
  minimize=Escape
  minimize=Escape

Now it does. I.e. key combos in the action being updated are ignored
when detecting collisions.

The example above is contrived; a real world example could be to
remove certain combos from an action with multiple combos; perhaps to
free up a combo for another action. Example:

  [search-bindings]
  cancel=Escape

This would previously cause an error since `cancel=Control+g Escape`
by default.

Closes #233
2020-12-05 11:21:17 +01:00
Craig Barnes
adde947fc5 config: replace union in config struct with simple width/height members 2020-11-30 02:24:38 +00:00
Daniel Eklöf
8e7658a135
config: add ‘dpi-aware’ option, defaulting to enabled
When disabled, foot no longers uses outputs’ DPI to scale the
font. Instead, it uses the outputs’ scaling factor.

That is, instead of appending “:dpi=123” to the fontconfig string,
modify the “:pixelsize” or “:size” attribute.

Closes #206
2020-11-19 19:25:48 +01:00
Daniel Eklöf
34abf665e2
config: add default.bold-text-in-bright option 2020-11-14 11:22:19 +01:00
Daniel Eklöf
5b43477cc2
config: enable allow-overflowing-double-width-glyphs by default 2020-11-13 17:50:16 +01:00
Daniel Eklöf
9ce79e2ef0
config: add support for pipe-* actions in mouse bindings
Closes #183
2020-11-06 19:30:05 +01:00
Daniel Eklöf
398f0b699a
config: mouse combos: set count=1 if user has omitted click count 2020-11-06 19:30:05 +01:00
Daniel Eklöf
8ede3dc886
config: break out “[cmd arg1 arg2]” parsing to separate function 2020-11-06 19:30:05 +01:00
Daniel Eklöf
a1a68b7d50
config: don’t use memcmp() to compare structs 2020-11-06 19:30:04 +01:00
Daniel Eklöf
f3e6941c9a
search: add {clipboard,primary}-paste key bindings
These bindings copy from the clipboard or primary selection into the
search buffer.

Default bindings:

* clipboard-paste: ctrl+v, ctrl+y
* primary-paste: shift+insert
2020-11-01 12:39:57 +01:00
Daniel Eklöf
2c101a21ee
config: add font-bold, font-italic and font-bold-italic options
These options lets the user configure custom fonts and styles, to use
with the bold and italic cell attributes.

By default, they are unset, meaning we use the bold/italic variants of
the regular font.

Closes #169.
2020-10-20 21:04:47 +02:00
Daniel Eklöf
17761dce63
csi: implement ‘CSI ? 1042 h/l’ - enable/disable bell-is-urgent 2020-10-11 17:44:29 +02:00
Daniel Eklöf
6ff97128fc
conf: csd.preferred can now be set to ‘none’
When csd.preferred == none, we will request CSDs from the compositor,
but internally render as if we are using SSDs. That is, we don’t
render any window decorations at all.

Note that some compositors may ignore our request to use CSDs, and
still render SSDs for us.

Closes #163
2020-10-10 13:07:29 +02:00
Daniel Eklöf
e54adbfa7c
Merge branch 'bind-shift+insert-to-primary-paste' into master 2020-10-10 13:05:55 +02:00
Daniel Eklöf
afafe12d5b
config: bind shift+insert to primary-paste by default 2020-10-10 10:27:42 +02:00
Daniel Eklöf
49f4b3da64
config: add ‘[default].word-delimiters’
This option lets the user configure which characters act as word
delimiters when selecting text.

This affects both “double clicking”, and ‘ctrl-w’ in scrollback search
mode.

Closes #156
2020-10-09 19:44:23 +02:00
Craig Barnes
afaeac0809 config: fix "-Wformat-nonliteral" warnings 2020-10-09 08:31:55 +01:00
Daniel Eklöf
7c6686221f
bell: optionally render margins in red when receiving BEL
Add anew config option, ‘bell=none|set-urgency’. When set to
‘set-urgency’, the margins will be painted in red (if the window did
not have keyboard focus).

This is intended as a cheap replacement for the ‘urgency’ hint, that
doesn’t (yet) exist on Wayland.

Closes #157
2020-10-08 19:55:32 +02:00
Daniel Eklöf
b1bdc2d4c1
config: ignore key/value pairs following an invalid section name
When we detected an invalid section name, we correctly logged this and
warned the user.

However, the internal state machine now had an invalid section enum
value. This caused a crash when the next key/value pair was to be
parsed and we tried to lookup which parser function to call.

Closes #159.
2020-10-07 18:34:48 +02:00
Daniel Eklöf
ebd1476baf
config: change default multiplier from 1.0 -> 3.0 2020-09-29 19:42:50 +02:00
Daniel Eklöf
f2497320c6
config: add mouse.alternate-scroll-mode option
This option controls the initial state of the Alternate Scroll Mode,
and defaults to ‘enabled’.
2020-09-15 19:12:29 +02:00