Merge branch 'master' into crosshair-v4

This commit is contained in:
Raimund Sacherer 2024-02-11 21:16:19 +01:00
commit 8f0a87b1b7
60 changed files with 1744 additions and 944 deletions

View file

@ -687,6 +687,17 @@ All _OSC_ sequences begin with *\\E]*, sometimes abbreviated _OSC_.
| \\E] 133 ; A \\E\\
: FinalTerm
: Mark start of shell prompt
| \\E] 133 ; C \\E\\
: FinalTerm
: Mark start of command output
| \\E] 133 ; D \\E\\
: FinalTerm
: Mark end of command output
| \\E] 176 ; _app-id_ \\E\\
: foot
: Set app ID. _app-id_ is optional; if assigned,
the terminal window App ID will be set to the value.
An empty App ID resets the value to the default.
| \\E] 555 \\E\\
: foot
: Flash the entire terminal (foot extension)

View file

@ -313,10 +313,10 @@ Foot supports URL detection. But, unlike many other terminal
emulators, where URLs are highlighted when they are hovered and opened
by clicking on them, foot uses a keyboard driven approach.
Pressing *ctrl*+*shift*+*o* enters _“Open URL mode”_, where all currently
Pressing *ctrl*+*shift*+*o* enters _"Open URL mode"_, where all currently
visible URLs are underlined, and is associated with a
_“jump-label”_. The jump-label indicates the _key sequence_
(e.g. *”AF”*) to use to activate the URL.
_"jump-label"_. The jump-label indicates the _key sequence_
(e.g. *"AF"*) to use to activate the URL.
The key binding can, of course, be customized, like all other key
bindings in foot. See *show-urls-launch* and *show-urls-copy* in
@ -398,7 +398,7 @@ For more information, see *foot.ini*(5).
New foot terminal instances (bound to *ctrl*+*shift*+*n* by default)
will open in the current working directory, if the shell in the
“parent” terminal reports directory changes.
"parent" terminal reports directory changes.
This is done with the OSC-7 escape sequence. Most shells can be
scripted to do this, if they do not support it natively. See the wiki
@ -424,6 +424,38 @@ See the wiki
(https://codeberg.org/dnkl/foot/wiki#user-content-jumping-between-prompts)
for details, and examples for other shells.
## Piping last command's output
The key binding *pipe-command-output* can pipe the last command's
output to an application of your choice (similar to the other
*pipe-\** key bindings):
*\[key-bindings\]++
pipe-command-output=[sh -c "f=$(mktemp); cat - > $f; footclient emacsclient -nw $f; rm $f"] Control+Shift+g*
When pressing *ctrl*+*shift*+*g*, the last command's output is written
to a temporary file, then an emacsclient is started in a new
footclient instance. The temporary file is removed after the
footclient instance has closed.
For this to work, the shell must emit an OSC-133;C (*\\E]133;C\\E\\\\*)
sequence before command output starts, and an OSC-133;D
(*\\E]133;D\\E\\\\*) when the command output ends.
In fish, one way to do this is to add _preexec_ and _postexec_ hooks:
*function foot_cmd_start --on-event fish_preexec
echo -en "\\e]133;C\\e\\\\"
end*
*function foot_cmd_end --on-event fish_postexec
echo -en "\\e]133;D\\e\\\\"
end*
See the wiki
(https://codeberg.org/dnkl/foot/wiki#user-content-piping-last-commands-output)
for details, and examples for other shells
# TERMINFO
Client applications use the terminfo identifier specified by the
@ -464,10 +496,10 @@ also implemented (and extended, to some degree) by Kitty.
It allows querying the terminal for terminfo classic, file-based,
terminfo definition. For example, if all applications used this
feature, you would no longer have to install foots terminfo on remote
feature, you would no longer have to install foot's terminfo on remote
hosts you SSH into.
XTerms implementation (as of XTerm-370) only supports querying key
XTerm's implementation (as of XTerm-370) only supports querying key
(as in keyboard keys) capabilities, and three custom capabilities:
- TN - terminal name
@ -479,7 +511,7 @@ Kitty has extended this, and also supports querying all integer and
string capabilities.
Foot supports this, and extends it even further, to also include
boolean capabilities. This means foots entire terminfo can be queried
boolean capabilities. This means foot's entire terminfo can be queried
via *XTGETTCAP*.
Note that both Kitty and foot handles responses to multi-capability
@ -490,7 +522,7 @@ capability/value pairs. There are a couple of issues with this:
- The success/fail flag in the beginning of the response is always 1
(success), unless the very first queried capability is invalid.
- XTerm will not respond at all to an invalid capability, unless its
- XTerm will not respond at all to an invalid capability, unless it's
the first one in the XTGETTCAP query.
- XTerm will end the response at the first invalid capability.
@ -554,16 +586,31 @@ In all other cases, the exit code is that of the client application
set according to either the *--term* command-line option or the
*term* config option in *foot.ini*(5).
*PWD*
Current working directory (at the time of launching foot)
*COLORTERM*
This variable is set to *truecolor*, to indicate to client
applications that 24-bit RGB colors are supported.
*PWD*
Current working directory (at the time of launching foot)
*SHELL*
Set to the launched shell, if the shell is valid (it is listed in
*/etc/shells*).
In addition to the variables listed above, custom environment
variables may be defined in *foot.ini*(5).
## Variables *unset* in the child process
*TERM_PROGRAM*
*TERM_PROGRAM_VERSION*
These environment variables are set by certain other terminal
emulators. We unset them, to prevent applications from
misdetecting foot.
In addition to the variables listed above, custom environment
variables to unset may be defined in *foot.ini*(5).
# BUGS
Please report bugs to https://codeberg.org/dnkl/foot/issues

View file

@ -252,6 +252,21 @@ empty string to be set, but it must be quoted: *KEY=""*)
Default: _100_.
*resize-by-cells*
Boolean.
When set to *yes*, the window size will be constrained to multiples
of the cell size (plus any configured padding). When set to *no*,
the window size will be unconstrained, and padding may be adjusted
as necessary to accommodate window sizes that are not multiples of
the cell size.
This option only applies to floating windows. Sizes of maxmized, tiled
or fullscreen windows will not be constrained to multiples of the cell
size.
Default: _yes_
*initial-window-size-pixels*
Initial window width and height in _pixels_ (subject to output
scaling), in the form _WIDTHxHEIGHT_. The height _includes_ the
@ -836,11 +851,12 @@ e.g. *search-start=none*.
*fullscreen*
Toggles the fullscreen state. Default: _none_.
*pipe-visible*, *pipe-scrollback*, *pipe-selected*
Pipes the currently visible text, the entire scrollback, or the
currently selected text to an external tool. The syntax for this
option is a bit special; the first part of the value is the
command to execute enclosed in "[]", followed by the binding(s).
*pipe-visible*, *pipe-scrollback*, *pipe-selected*, *pipe-command-output*
Pipes the currently visible text, the entire scrollback, the
currently selected text, or the last command's output to an
external tool. The syntax for this option is a bit special; the
first part of the value is the command to execute enclosed in
"[]", followed by the binding(s).
You can configure multiple pipes as long as the command strings
are different and the key bindings are unique.
@ -848,9 +864,14 @@ e.g. *search-start=none*.
Note that the command is *not* automatically run inside a shell;
use *sh -c "command line"* if you need that.
Example:
*pipe-visible=[sh -c "xurls | uniq | tac | fuzzel | xargs -r
firefox"] Control+Print*
Example #1:
# Extract currently visible URLs, let user choose one (via
fuzzel), then launch firefox with the selected URL++
*pipe-visible=[sh -c "xurls | uniq | tac | fuzzel | xargs -r firefox"] Control+Print*
Example #2:
# Open scrollback contents in Emacs running in a new foot instance++
*pipe-scrollback=[sh -c "f=$(mktemp) && cat - > $f && foot emacsclient -t $f; rm $f"] Control+Shift+Print*
Default: _none_

View file

@ -73,6 +73,11 @@ terminal has terminated.
The child process in the new terminal instance will use
footclient's environment, instead of the server's.
Environment variables listed in the *Variables set in the child
process* section will be overwritten by the foot server. For
example, the new terminal will use *TERM* from the configuration,
not footclient's environment.
*-d*,*--log-level*={*info*,*warning*,*error*,*none*}
Log level, used both for log output on stderr as well as
syslog. Default: _warning_.
@ -163,9 +168,27 @@ fallback to the less specific path, with the following priority:
This variable is set to *truecolor*, to indicate to client
applications that 24-bit RGB colors are supported.
*PWD*
Current working directory (at the time of launching foot)
*SHELL*
Set to the launched shell, if the shell is valid (it is listed in
*/etc/shells*).
In addition to the variables listed above, custom environment
variables may be defined in *foot.ini*(5).
## Variables *unset* in the child process
*TERM_PROGRAM*
*TERM_PROGRAM_VERSION*
These environment variables are set by certain other terminal
emulators. We unset them, to prevent applications from
misdetecting foot.
In addition to the variables listed above, custom environment
variables to unset may be defined in *foot.ini*(5).
# SEE ALSO
*foot*(1)