Files
fish-shell/doc_src/cmds
Johannes Altmanninger 3453565a41 Builtin for querying terminal capabilities/name/version
The next commit wants to add a conditional default for styled underlines.
Due to various incompatibilities in terminals, our best option seems to ask
the terminal.

Today we can make XTGETTCAP queries using something like

	printf '\eP+q5373\e\\' # Su
	printf '\e[0c'
	while read -n 1
	    ...
	end

This doesn't seem safe because builtin read might consume other data written
by the terminal such as keyboard input.

Avoid this problem by providing it as a builtin that can enqueue unrelated
input and process it after the query has been answered.

For the same reason, add a builtin to query for XTVERSION; this allows us
to add workarounds for specific terminals (example in the next commit).

TODO:
- Naming -- maybe add a level of nesting:

	status query-terminal xtgettcap
	status query-terminal xtversion
	# Possible future additions:
	status query-terminal os-name
	status query-terminal cursor-position

or "status query-xtgettcap".
We could also hide the exact protocol by saying
"status query terminfo-capability".

Note that xtgettcap, xtversion and os-name are expected to always give the
same results throughout the lifetime of the fish process.  Keep caching
XTVERSION as before, though that's probably not needed.

Future work:

XTGETTCAP potentially supports all of terminfo: boolean, numeric and string
capabilities. Today we have no use beyond checking for presence/absence of
a capabilty. If we ever need more, we can use stdout.
2025-04-29 13:59:27 +02:00
..
2025-02-11 22:51:06 +08:00
2024-09-18 22:11:14 +02:00
2023-06-05 18:26:13 +02:00
2025-04-24 19:54:39 +02:00
2024-04-23 19:36:11 +02:00
2025-03-01 07:55:53 +01:00
2025-03-30 19:42:00 +02:00
2022-03-12 00:21:13 +08:00
2022-03-12 00:21:13 +08:00
2025-04-11 15:11:22 +02:00
2023-11-18 18:27:25 -08:00
2025-04-11 17:29:22 +02:00
2025-03-30 19:42:00 +02:00
2023-01-09 20:33:37 +01:00
2023-02-28 20:49:11 +01:00
2022-10-19 20:10:26 +02:00
2024-06-23 17:45:52 -05:00
2022-03-12 00:21:13 +08:00
2022-03-12 00:21:13 +08:00
2022-03-12 00:21:13 +08:00
2024-09-14 10:29:44 +02:00
2025-03-15 16:36:13 +01:00
2025-01-06 19:40:30 -06:00
2025-01-06 19:40:30 -06:00
2022-03-12 00:21:13 +08:00
2023-01-09 20:33:37 +01:00
2022-09-17 21:31:06 +08:00
2022-03-12 00:21:13 +08:00
2024-09-18 22:11:14 +02:00