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.
Showing the changes to player/javascript (1 of 4 files). Show all
Unified · Split
| @@ -675,9 +675,12 @@ mp.input = { · 674 unmodified lines | ||
| 675 | 675 | terminate: function () { |
| 676 | 676 | mp.commandv("script-message-to", "console", "disable"); |
| 677 | 677 | }, |
| 678 | − log: function (message, style) { | |
| 679 | − mp.commandv("script-message-to", "console", "log", | |
| 680 | − JSON.stringify({ text: message, style: style })); | |
| 678 | + log: function (message, style, terminal_style) { | |
| 679 | + mp.commandv("script-message-to", "console", "log", JSON.stringify({ | |
| 680 | + text: message, | |
| 681 | + style: style, | |
| 682 | + terminal_style: terminal_style, | |
| 683 | + })); | |
| 681 | 684 | }, |
| 682 | 685 | log_error: function (message) { |
| 683 | 686 | mp.commandv("script-message-to", "console", "log", |