summaryrefslogtreecommitdiffstats
path: root/player/javascript/defaults.js
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 /player/javascript/defaults.js
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 'player/javascript/defaults.js')
-rw-r--r--player/javascript/defaults.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/player/javascript/defaults.js b/player/javascript/defaults.js
index cc2ca3f232..b97999485c 100644
--- a/player/javascript/defaults.js
+++ b/player/javascript/defaults.js
@@ -675,9 +675,12 @@ mp.input = {
terminate: function () {
mp.commandv("script-message-to", "console", "disable");
},
- log: function (message, style) {
- mp.commandv("script-message-to", "console", "log",
- JSON.stringify({ text: message, style: style }));
+ log: function (message, style, terminal_style) {
+ mp.commandv("script-message-to", "console", "log", JSON.stringify({
+ text: message,
+ style: style,
+ terminal_style: terminal_style,
+ }));
},
log_error: function (message) {
mp.commandv("script-message-to", "console", "log",