From c50a4428103b5fd5c0ce204d850ec343cdab5fd6 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 24 Jul 2020 17:50:48 +0200 Subject: readme: add section describing how to identify foot --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 7aa29df4..de0f5b7a 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ The fast, lightweight and minimalistic Wayland terminal emulator. 1. [Backspace](#backspace) 1. [DPI and font size](#dpi-and-font-size) 1. [Supported OSCs](#supported-oscs) +1. [Programmatically checking if running in foot](#programmatically-checking-if-running-in-foot) 1. [Requirements](#requirements) 1. [Running](#running) 1. [Building](#building) @@ -301,6 +302,39 @@ with the terminal emulator itself. Foot implements the following OSCs: * `OSC 555` - flash screen (**foot specific**) +## Programmatically checking if running in foot + +Foot does **not** set any environment variables that can be used to +identify foot (reading `TERM` is not reliable since the user may have +chosen to use a different terminfo). + +You can instead use the escape sequences to read the _Secondary_ and +_Tertiary Device Attributes_ (secondary/tertiary DA, for short). + +The tertiary DA response is always `\EP!|464f4f54\E\\`. The `\EP!|` is +the standard tertiary DA response prefix, `DCS ! |`. The trailing +`\E\\` is of course the standard string terminator, `ST`. + +In the response above, the interresting part is `464f4f54`; this is +the string _FOOT_ in hex. + +The secondary DA response is `\E[>1;XXYYZZ;0c`, where XXYYZZ is foot's +major, minor and patch version numbers, in decimal, using two digits +for each number. For example, foot-1.4.2 would respond with +`\E[>1;010402;0c`. + +**Note**: not all terminal emulators implement tertiary DA. Most +implement secondary DA, but not all. All _should_ however implement +_Primary DA_. + +Thus, a safe way to query the terminal is to request the tertiary, +secondary and primary DA all at once, in that order. All terminals +should ignore escape sequences they do not recognize. You will have to +parse the response (which in foot will consist of all three DA +responses, all at once) to determine which requests the terminal +emulator actually responded to. + + ## Requirements ### Running -- cgit v1.3 From 057ff3ba2104b0d4058a389bcef42abd013eec2c Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 25 Jul 2020 09:52:30 +0200 Subject: readme: spelling fixes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index de0f5b7a..2e1e88b8 100644 --- a/README.md +++ b/README.md @@ -223,14 +223,14 @@ want to launch a new terminal. By default, foot prefixes _Meta characters_ with ESC. This corresponds to XTerm's `metaSendsEscape` option set to `true`. -This can be disabled programatically with `\E[?1036l` (and enabled +This can be disabled programmatically with `\E[?1036l` (and enabled again with `\E[?1036h`). When disabled, foot will instead set the 8:th bit of meta character and then UTF-8 encode it. This corresponds to XTerm's `eightBitMeta` option set to `true`. -This can also be disabled programatically with `rmm` (_reset meta +This can also be disabled programmatically with `rmm` (_reset meta mode_, `\E[?1034l`), and enabled again with `smm` (_set meta mode_, `\E[?1034h`). -- cgit v1.3 From 38ba3f5429af2966a1448e41f90f0b259abe0adc Mon Sep 17 00:00:00 2001 From: Jonas 'cherti' Große Sundrup Date: Sat, 25 Jul 2020 13:18:12 +0200 Subject: Add configuration instructions to the README --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 2e1e88b8..233703d1 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ The fast, lightweight and minimalistic Wayland terminal emulator. ## Index 1. [Features](#features) +1. [Configuration](#configuration) 1. [Troubleshooting](#troubleshooting) 1. [Why the name 'foot'?](#why-the-name-foot) 1. [Fonts](#fonts) @@ -34,7 +35,6 @@ The fast, lightweight and minimalistic Wayland terminal emulator. 1. [Bugs](#bugs) 1. [Mastodon](#mastodon) - ## Features * Fast (see [benchmarks](doc/benchmark.md)) @@ -53,6 +53,14 @@ The fast, lightweight and minimalistic Wayland terminal emulator. ![wow](doc/sixel-wow.png "Sixel screenshot") +## Configuration + +**foot** can be configured by creating a file `$XDG_CONFIG_HOME/footrc` (defaulting to `~/.config/footrc`). +A template for that can usually be found in `/usr/share/foot/footrc` or +[here](https://codeberg.org/dnkl/foot/src/branch/master/footrc). + +Further information can be found in foot's manpage `foot(5)`. + ## Troubleshooting -- cgit v1.3