Commit graph

471 commits

Author SHA1 Message Date
Daniel Eklöf
efc619b0af
config: make ‘starlight’ the default color theme
Closes #1321
2023-07-14 10:11:43 +02:00
Daniel Eklöf
0e1dbbbd06
doc: foot: add default key binding for unicode input 2023-07-10 12:37:10 +02:00
Daniel Eklöf
5b74808ed0
doc: foot: update default key binding for URL mode 2023-07-10 12:36:55 +02:00
Antoine Beaupré
080a11eb73
bind control-shift-u to unicode-input, move urls to o
Having a keybinding to invoke arbitrary unicode characters is very
useful. It's often used as a method of last resort to communicate with
people outside of your main language. For example, if you want to type
the last letter of my real name, you can invoke the latin-1 character
0xe9 or unicode 0x00e9.

You can also use this to type special characters, for example, unicode
U+1F4A9 is of course, the infamous PILE OF POO, which is sure to
produce million laughs everywhere you go.

In foot, there's no keybinding by default to invoke the very useful
unicode-input command. There is no "standard" (as in "ISO") keybinding
this either. But there *is* a de-facto standard currently deployed
by *both* GTK and Qt (a rare feat) *and* Chrome OS (an even rarer
feat) and it's control-shift-u.

Alternatives include Control-x 8 (emacs), Control V u (vim),
Alt (Windows, LibreOffice), or Option (Mac). I doubt we want to adopt
any of those.

So let's use control-shift-u for this. Unfortunately, it's currently
assigned to show-urls-launch, which is unfortunate, but
insurmountable. We can reassign this keybinding elsewhere. I have
picked control-shift-o in my configuration, because "o" is a good
mnemonic for "open URLs". Others have suggested "m" instead.

Closes: #1183
2023-07-10 12:31:51 +02:00
CismonX
d2fcb5343f
input: add basic support for touchscreen input
Closes #517
2023-07-05 16:22:28 +02:00
Daniel Eklöf
64b6b5d2a7
config: dpi-aware: remove ‘auto’ value, and default to ‘no’
We now default to scaling fonts using the scaling factor, not monitor
DPI.

The ‘auto’ value for dpi-aware has been removed.

Documentation (man pages and README) have been updated to reflect the
new default.
2023-06-29 15:38:23 +02:00
wout
70ffc2632f Fixed a type for the pixel fontsize change
xp -> px
2023-06-23 18:10:19 +00:00
sewn
16872ecc41
meson: use meson feed feature for scdoc input
Removes the need for a shell dependency.
2023-06-14 17:15:20 +00:00
jdevdevdev
134b54dfe0
.desktop: remove StartupWMClass from server, use distinct StartupWMClass for foot and footclient
For this to work, the default app-id of footclient has been changed
from ‘foot’ to ‘footclient’.

By using distinct StartupWMClasses, the compositor can connect a
running foot/footclient instance to the correct .desktop-file. This
ensures the correct icon is being used in e.g. docks, and that actions
like “open another window” works correctly.

Note that the user can override the app-id, either by setting app-id
in foot.ini, or with the -a,--app-id command line option.

Closes #1355
2023-05-22 18:57:54 +02:00
Daniel Eklöf
e78319fccd
utmp: rewrite utmp logging
This patch generalizes the utmp support, to not only support
libutempter, but also ulog (and in the future, even more interfaces).

* Rename config option main.utempter to main.utmp-helper
* Add meson option -Dutmp-backend=none|libutempter|ulog|auto
* Rename meson option -Ddefault-utempter-path to -Dutmp-default-helper-path
* utmp is no longer detected at compile time, but at runtime instead.

Meson will configure the following pre-processor macros, based on the
selected utmp backend:

* UTMP_ADD - argument to pass to utmp helper when adding a record (starting foot)
* UTMP_DEL - argument to pass to utmp helper when removing a record (exiting foot)
* UTMP_DEL_HAVE_ARGUMENT - if defined, UTMP_DEL expects an extra argument ($WAYLAND_DISPLAY)
* UTMP_DEFAULT_HELPER_PATH - path to the default utmp helper binary

The documentation has been updated to mention which arguments are
passed to the helper binary.

Closes #1314
2023-05-22 18:47:25 +02:00
Daniel Eklöf
a2f765b72a
slave: unset TERM_PROGRAM{,_VERSION}
Foot’s policy is to not set environment variables that identifies
it (except the well-known and established `TERM` variable).

We encourage applications to use terminfo to determine capabilities,
or terminal queries, when available. Or, at least use terminal queries
to detect the terminal and its version.

Setting environment variables is a bad idea since they are inherited
by all applications started by the terminal (which is the whole
point). But, this includes other terminal emulators, making it very
possible a terminal emulator gets mis-detected just because it was
started from another terminal.

Since there are a couple of terminal emulators that _do_ set
TERM_PROGRAM and TERM_PROGRAM_VERSION, unset these environment
variables to avoid being misdetected.

Closes #1349
2023-05-18 17:50:48 +02:00
Daniel Eklöf
dc7642f2a5
csi: implement "CSI ? m" 2023-04-26 18:30:09 +02:00
Harri Nieminen
ae26915916 fix typos 2023-03-29 00:45:18 +03:00
Craig Barnes
5b2f02d826 slave: set $TERM_PROGRAM and $TERM_PROGRAM_VERSION environment variables
These are already being set by iTerm2, WezTerm, tmux and likely some
others. Even though using yet more environment variables seems rather
questionable, if we don't set these we run the risk of inheriting them
from other terminals.

See also:

* 97a6078df8/sources/PTYSession.m (L2568-2570)
* 1d0f68dee9/environ.c (L263-L264)
* https://github.com/search?q=TERM_PROGRAM&type=code
2023-03-20 14:40:36 +00:00
Craig Barnes
f2356adee3 doc: foot.ini: fix spelling mistake in [bell].urgent description 2023-02-16 09:12:53 +00:00
Craig Barnes
25154a8150 doc: ctlseq: fix capitalization in description of DA3 sequence 2023-02-16 08:50:53 +00:00
Grigory Kirillov
a38b8d0222 doc: fix a typo 2023-01-08 00:55:01 +03:00
Daniel Eklöf
6259d59b4d
config: change default grapheme-width-method from wcswidth to double-width
The old default, wcswidth, simply calls wcswidth() on the grapheme
cluster. This was supposedly the implementation with the highest
application compatibility. Except we never even tried to measure
it. It was just assumed.

A lot of modern applications have better implementations. Let’s try to
push support for better emoji support by changing our default method
from wcswith to double-width.

While far from correct (it’s not based on the Unicode tables), the
‘double-width’ method produces accurate results anyway.

double-width is like wcswidth(), in that it adds together the
individual wcwidths of all codepoints in the grapheme cluster. But, it
limits the maximum width to 2.
2023-01-01 10:29:27 +01:00
Daniel Eklöf
f6ca8c90e1
config: add ‘font-size-adjustment=N[px|%]’ option
This patch adds a new config option, font-size-adjustment.

It lets you configure how much the font size should be
incremented/decremented when zooming in or out (ctrl-+, ctrl+-).

Values can be specified in points, pixels or percent.

Closes #1188
2022-12-17 10:59:17 +01:00
Daniel Eklöf
3b9aca6a3d
doc: foot-ctlseq: expand last column to fill screen in all tables 2022-12-14 12:20:52 +01:00
Daniel Eklöf
646314469a
doc: foot.ini: add example, and mention string options can be quoted 2022-12-06 19:36:07 +01:00
Daniel Eklöf
1486c57bdb
doc: foot: add PWD to list of env vars set in child process 2022-12-04 19:49:02 +01:00
Craig Barnes
1b24cf4fcb doc: ctlseq: add trailing space to fix XTGETTCAP entry in DCS table
Without the trailing space, both the sequence and the description
were getting packed into a single table column.
2022-11-24 20:34:41 +00:00
Daniel Eklöf
dfabc5d754
readme/foot.1: mention that we now need “-d info” to get log output 2022-11-23 16:27:50 +01:00
Antoine Beaupré
b80c7f75fe
change default log level to WARNING
The default foot output looks like this, in Debian testing "bookworm"
at the time of writing:

    anarcat@angela:pubpaste$ foot true
    info: main.c:421: version: 1.13.1 +pgo +ime +graphemes -assertions
    info: main.c:428: arch: Linux x86_64/64-bit
    info: main.c:440: locale: fr_CA.UTF-8
    info: config.c:3003: loading configuration from /home/anarcat/.config/foot/foot.ini
    info: fcft.c:338: fcft: 3.1.5 +graphemes -runs +svg(nanosvg) -assertions
    info: fcft.c:377: fontconfig: 2.13.1, freetype: 2.12.1, harfbuzz: 5.2.0
    info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=8.00pt/8px, dpi=75.00
    info: wayland.c:1353: eDP-1: 2256x1504+0x0@60Hz 0x095F 13.32" scale=2 PPI=205x214 (physical) PPI=136x143 (logical), DPI=271.31
    info: wayland.c:1509: requesting SSD decorations
    info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Bold.otf: size=24.00pt/32px, dpi=96.00
    info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=24.00pt/32px, dpi=96.00
    info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Bold.otf: size=24.00pt/32px, dpi=96.00
    info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=24.00pt/32px, dpi=96.00
    info: terminal.c:700: cell width=19, height=39
    info: terminal.c:588: using 16 rendering threads
    info: wayland.c:859: using SSD decorations
    info: main.c:680: goodbye
    anarcat@angela:pubpaste$

That's 17 lines of output that are *mostly* useless for most use
cases. I might understand having this output during the project's
startup, when it's helpful for diagnostics, but now Foot just mostly
works everywhere, and I've never had a use for any of that stuff in
the (arguably short) time I've been using Foot so far.

And if I do, there's the `--log-level` commandline option to tweak
this. At first, I looked at tweaking the log level through the config
file. But as explained in this issue:

https://codeberg.org/dnkl/foot/issues/1142

... there's a chicken and egg problem there that makes it hard to
implement and possibly confusing for users as well.

There's also the possibility for users to change the shortcut with
which they start foot, for example a `.desktop` file so that menu
systems that support those start foot properly. But that only works in
that environment, and not through the so many things that will just
call `foot` and hope it will do the right thing.

In my case, I have `foot` hardcoded in a lot of places now, between
sway and waybar, and this is only going to grow. Others have suggested
adding the flag to a $TERMINAL global variable, but that won't help
.desktop users.

So, instead of playing whack-a-mole with the log levels, just make it
so that, by default, foot is silent. This is actually one of the
[basics of UNIX philosophy][1]:

> Rule of Silence: When a program has nothing surprising to say, it
> should say nothing.

And yes, I am aware I am severely violating that principle by writing
a way too long commit log for a one-line patch, but there you go, I
figured it was good to document the why of this properly.

[1]: https://web.archive.org/web/20031102053334/http://www.faqs.org/docs/artu/ch01s06.html
2022-11-22 10:22:22 -05:00
Daniel Eklöf
b0c30c7ed2
doc: foot.ini: improve documentation of cursor.color 2022-10-17 20:16:53 +02:00
Daniel Eklöf
8179d73daa
render: delay reflow for ‘resize-delay-ms’ milliseconds
Reflowing a large scrollback is *slow*. During an interactive resize,
it can easily take long enough that the compositor fills the Wayland
socket with configure events. Eventually, the socket becomes full and
the compositor terminates the connection, causing foot to exit.

This patch is work-in-progress, and the first step towards alleviating
this.

It delays the reflow by:

* Snapshotting (copying) the original grid when an interactive resize
  is started.
* While resizing, we apply a simple truncation resize of the
  grid (like we handle the alt screen).
* When the resize is done, or paused for ‘resize-delay-ms’, the grid
  is reflowed.

TODO: we *must* not allow any changes to the temporary (truncated)
grid during the resize. Any changes to the grid would be lost when the
final reflow is applied. That is, we must completely pause the ptmx
pipe while a resize is in progress.

Future improvements:

The initial copy can be slow. We should be able to avoid it by
rewriting the reflow algorithm to not free anything. This is
complicated by the fact that some resources (e.g. sixel images) are
currently *moved* to the new grid. They’d instead have to be copied.
2022-10-10 17:19:17 +02:00
Nick Hastings
cbebafbfe8 doc: fix tiny typo 2022-10-04 13:04:03 +09:00
Daniel Eklöf
aa10b1d2da
Add support for creating utmp records
This patch adds support for creating utmp records using the ‘utempter’
helper binary from the ‘libutempter’ package.

* New config option ‘main.utempter’
* New meson command line option, -Ddefault-utempter-path. Defaults to
  auto-detecting the path.

The default value of the new ‘main.utempter’ config option depends on
the meson command line option ‘-Ddefault-utempter-path’.

If ‘main.utempter’ is *not* set to ‘none’, foot will try to execute
the utempter helper binary to create utmp records when a new terminal
is instantiated. The record is removed when the terminal instance is
destroyed.
2022-09-23 23:02:25 +02:00
Daniel Eklöf
2d1ded183a
config: change default ‘pad’ to 0x0 (i.e. no padding) 2022-09-03 12:17:46 +02:00
Daniel Eklöf
3cf11bfea9
theme: change default color theme to solarized-dark-normal-brights
This is my variant of the solarized theme, were only the first eight
colors (i.e. the "normal") colors are from the solarized theme. The
remaining eight (the "bright" colors) are brightened versions of the
"normal" colors. This results in a theme that is usually in all
applications, not just those that are "aware" that the terminal color
theme is "solarized".
2022-08-22 13:37:12 +02:00
Yorick Peterse
a0942f950d
config: add setting for underline thickness
This adds an "underline-thickness" setting to the "main" section,
similar to the existing "underline-offset" setting. This setting is used
to specify a custom height for regular (= non-cursor) underlines.

Fixes #1136
2022-08-20 22:16:32 +02:00
Daniel Eklöf
0cbd99710b
unicode-mode: ‘q’ aborts Unicode input mode 2022-07-29 11:56:41 +02:00
Daniel Eklöf
8967dd9cfe
input: add new Unicode input mode
This mode is activated through the new key-bindings.unicode-input and
search-bindings.unicode-input key bindings.

When active, the user can “build” a Unicode codepoint by typing its
hexadecimal value.

Note that there’s no visual feedback in this mode. This is
intentional. This mode is intended to be a fallback for users that
don’t use an IME.

Closes #1116
2022-07-29 09:26:31 +02:00
Daniel Eklöf
d79a3b9350
config: add colors.search-box-{no-,}match
Closes #1112
2022-07-28 19:02:56 +02:00
Daniel Eklöf
bdb79e8b9f
osc: add support for OSC 133;A (prompt markers)
This patch adds support for the OSC-133;A sequence, introduced by
FinalTerm and implemented by iTerm2, Kitty and more. See
https://iterm2.com/documentation-one-page.html#documentation-escape-codes.html.

The shell emits the OSC just before printing the prompt. This lets the
terminal know where, in the scrollback, there are prompts.

We implement this using a simple boolean in the row struct ("this row
has a prompt"). The prompt marker must be reflowed along with the text
on window resizes.

In an ideal world, erasing, or overwriting the cell where the OSC was
emitted, would remove the prompt mark. Since we don't store this
information in the cell struct, we can't do that. The best we can do
is reset it in erase_line(). This works well enough in the "normal"
screen, when used with a "normal" shell. It doesn't really work in
fullscreen apps, on the alt screen. But that doesn't matter since we
don't support jumping between prompts on the alt screen anyway.

To be able to jump between prompts, two new key bindings have been
added: prompt-prev and prompt-next, bound to ctrl+shift+z and
ctrl+shift+x respectively.

prompt-prev will jump to the previous, not currently visible, prompt,
by moving the viewport, ensuring the prompt is at the top of the
screen.

prompt-next jumps to the next prompt, visible or not. Again, by moving
the viewport to ensure the prompt is at the top of the screen. If
we're at the bottom of the scrollback, the viewport is instead moved
as far down as possible.

Closes #30
2022-06-16 19:02:10 +02:00
Daniel Eklöf
5760bcb3bf
doc: document the new ‘environment’ config section 2022-06-13 11:55:23 +02:00
Daniel Eklöf
bc7214cd88
config: use $HOME instead of getpwuid() to retrieve users’s home dir
When searching for foot.ini, use $HOME instead of getpwuid() to
retrieve the user’s home directory.
2022-05-25 17:02:41 +02:00
Daniel Eklöf
56e5855fff
doc: benchmarks: update with desktop results for 1.12.1 (r9) 2022-05-12 13:10:24 +02:00
Daniel Eklöf
834beb966e
doc: benchmarks: update with laptop results for 1.12.1 (r9) 2022-05-12 11:53:08 +02:00
Daniel Eklöf
aa4c7c5a30
config: add ctrl+shift+v and XF86 paste to SEARCH_CLIPBOARD_PASTE
We now bind ctrl+v, ctrl+shift+v, ctrl+y and XF86Paste to pasting from
the clipboard into the scrollback search buffer.

Why all these? Because we can, and because all are common shortcuts
for pasting:

* ctrl+v: “normal” apps use this by default
* ctrl+shift+v: used in terminals (including foot)
* ctrl+y: Emacs
* XF86Paste: special keyboard key, for pasting
2022-04-26 20:37:30 +02:00
Daniel Eklöf
f0f0fac77f
doc: foot.ini: drop empty line after *show-urls-launch* 2022-04-23 20:08:09 +02:00
Merlin Büge
e6f884a9e1
doc + meson.build: update information about foot.ini, small cleanup
- foot.ini.5: mention location of example config file
- foot.1: replace outdated (or incomplete) information about the
  location of the config file with references to foot.ini.5
- foot.1 and foot.ini.5: conform to scdoc specification, thus surround each
  header with (at least) one blank line. additionally consistently use exactly
  one line before/after each header (was sometimes two before)
- foot.1: some parts of the keybindings had their own section, move into
  KEYBOARD SHORTCUTS section
- foot.1: move EXIT STATUS section to the end where it is commonly found
- foot.1: copy information about config file handling from the beginning of
  foot.ini.5 into the CONFIGURATION section of foot.1
- INSTALL.md: foot.ini is no longer included in the documentation
- meson.build: do not bundle foot.ini with documentation anymore, see also
  https://codeberg.org/dnkl/foot/pulls/1015

Closes #1002
2022-04-22 17:00:04 +02:00
Daniel Eklöf
8485cdaaaa
csi: implement CSI > 4n (reset modifyOtherKeys) 2022-04-19 17:25:06 +02:00
Daniel Eklöf
501a9fbb5e
url-mode: add a key binding that enables “persistent” URL mode
This is an alternative to ‘show-urls-launch’, where we stay in URL
mode after activating an URL.

Closes #964
2022-04-17 11:24:27 +02:00
Daniel Eklöf
fbcebd4f1c
config: add [csd].hide-when-maximized=yes|no
When enabled, the CSD titlebar will be hidden when the window is
maximized.

Closes #1019
2022-04-16 11:45:50 +02:00
Merlin Büge
5539eac590
fix some small typos 2022-04-13 09:41:10 +02:00
Daniel Eklöf
3c6836e32d
doc: footclient: codespell 2022-04-12 15:07:41 +02:00
Daniel Eklöf
fd1e5feda4
doc: footclient: add -E,--client-environment 2022-04-12 15:07:41 +02:00
Daniel Eklöf
6792f5fce0
doc: ctlseq: document XTMODKEYS 2022-04-10 18:36:04 +02:00