summaryrefslogtreecommitdiffstats
path: root/DOCS/man/lua.rst
diff options
context:
space:
mode:
authorGuido Cella <guido@guidocella.xyz>2024-01-13 08:40:16 +0100
committersfan5 <sfan5@live.de>2024-01-14 23:26:07 +0100
commitdfecc9f083780530282b099708f855e9242fc886 (patch)
treee8e828058529d615bebbdfe7c46739abd0dd0447 /DOCS/man/lua.rst
parentf33a4d2fd99480045764b45c06f11ac0be1ed45b (diff)
downloadmpv-dfecc9f083780530282b099708f855e9242fc886.tar.bz2
mpv-dfecc9f083780530282b099708f855e9242fc886.tar.xz
console.lua: style log lines in the terminal
When running the console in the terminal, style log lines with the same escape sequences as msg.c. mp.input can also specify terminal escape sequences, e.g. a script to select a playlist entry can invert the color of the selection. Also add a missing newline to help's error message.
Diffstat (limited to 'DOCS/man/lua.rst')
-rw-r--r--DOCS/man/lua.rst14
1 files changed, 10 insertions, 4 deletions
diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst
index ac062aec6c..1ea612a0be 100644
--- a/DOCS/man/lua.rst
+++ b/DOCS/man/lua.rst
@@ -922,9 +922,10 @@ REPL.
``input.terminate()``
Close the console.
-``input.log(message, style)``
+``input.log(message, style, terminal_style)``
Add a line to the log buffer. ``style`` can contain additional ASS tags to
- apply to ``message``.
+ apply to ``message``, and ``terminal_style`` can contain escape sequences
+ that are used when the console is displayed in the terminal.
``input.log_error(message)``
Helper to add a line to the log buffer with the same color as the one the
@@ -933,7 +934,8 @@ REPL.
``input.set_log(log)``
Replace the entire log buffer.
- ``log`` is a table of strings, or tables with ``text`` and ``style`` keys.
+ ``log`` is a table of strings, or tables with ``text``, ``style`` and
+ ``terminal_style`` keys.
Example:
@@ -941,7 +943,11 @@ REPL.
input.set_log({
"regular text",
- { style = "{\\c&H7a77f2&}", text = "error text" }
+ {
+ text = "error text",
+ style = "{\\c&H7a77f2&}",
+ terminal_style = "\027[31m",
+ }
})
Events