2019-12-07 16:16:10 +00:00
|
|
|
CONSOLE
|
|
|
|
=======
|
|
|
|
|
|
|
|
The console is a REPL for mpv input commands. It is displayed on the video
|
|
|
|
window. It also shows log messages. It can be disabled entirely using the
|
2024-10-17 17:51:47 +00:00
|
|
|
``--load-console=no`` option.
|
2019-12-07 16:16:10 +00:00
|
|
|
|
|
|
|
Keybindings
|
|
|
|
-----------
|
|
|
|
|
|
|
|
\`
|
|
|
|
Show the console.
|
|
|
|
|
2023-10-10 06:33:08 +00:00
|
|
|
ESC and Ctrl+[
|
2019-12-07 16:16:10 +00:00
|
|
|
Hide the console.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
ENTER, Ctrl+j and Ctrl+m
|
2019-12-07 16:16:10 +00:00
|
|
|
Run the typed command.
|
|
|
|
|
|
|
|
Shift+ENTER
|
|
|
|
Type a literal newline character.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
LEFT and Ctrl+b
|
2021-10-31 10:30:25 +00:00
|
|
|
Move the cursor to the previous character.
|
2019-12-07 16:16:10 +00:00
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
RIGHT and Ctrl+f
|
2021-10-31 10:30:25 +00:00
|
|
|
Move the cursor to the next character.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
Ctrl+LEFT and Alt+b
|
2021-10-31 10:30:25 +00:00
|
|
|
Move the cursor to the beginning of the current word, or if between words,
|
|
|
|
to the beginning of the previous word.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
Ctrl+RIGHT and Alt+f
|
2021-10-31 10:30:25 +00:00
|
|
|
Move the cursor to the end of the current word, or if between words, to the
|
|
|
|
end of the next word.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
HOME and Ctrl+a
|
2021-10-31 10:30:25 +00:00
|
|
|
Move the cursor to the start of the current line.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
END and Ctrl+e
|
2021-10-31 10:30:25 +00:00
|
|
|
Move the cursor to the end of the current line.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
BACKSPACE and Ctrl+h
|
2021-10-31 10:30:25 +00:00
|
|
|
Delete the previous character.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
Ctrl+d
|
2021-10-31 10:30:25 +00:00
|
|
|
Hide the console if the current line is empty, otherwise delete the next
|
|
|
|
character.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
Ctrl+BACKSPACE and Ctrl+w
|
2021-10-31 10:30:25 +00:00
|
|
|
Delete text from the cursor to the beginning of the current word, or if
|
|
|
|
between words, to the beginning of the previous word.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
Ctrl+DEL and Alt+d
|
2021-10-31 10:30:25 +00:00
|
|
|
Delete text from the cursor to the end of the current word, or if between
|
|
|
|
words, to the end of the next word.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
Ctrl+u
|
2021-10-31 10:30:25 +00:00
|
|
|
Delete text from the cursor to the beginning of the current line.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
Ctrl+k
|
2021-10-31 10:30:25 +00:00
|
|
|
Delete text from the cursor to the end of the current line.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
Ctrl+c
|
2021-10-31 10:30:25 +00:00
|
|
|
Clear the current line.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
UP and Ctrl+p
|
2021-10-31 10:30:25 +00:00
|
|
|
Move back in the command history.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
DOWN and Ctrl+n
|
2021-10-31 10:30:25 +00:00
|
|
|
Move forward in the command history.
|
2019-12-07 16:16:10 +00:00
|
|
|
|
|
|
|
PGUP
|
|
|
|
Go to the first command in the history.
|
|
|
|
|
|
|
|
PGDN
|
2021-10-31 10:30:25 +00:00
|
|
|
Stop navigating the command history.
|
2019-12-07 16:16:10 +00:00
|
|
|
|
2024-08-14 16:18:48 +00:00
|
|
|
Ctrl+r
|
|
|
|
Search the command history.
|
|
|
|
|
2019-12-07 16:16:10 +00:00
|
|
|
INSERT
|
|
|
|
Toggle insert mode.
|
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
Ctrl+v
|
2021-10-31 10:30:25 +00:00
|
|
|
Paste text (uses the clipboard on X11 and Wayland).
|
|
|
|
|
2019-12-07 16:16:10 +00:00
|
|
|
Shift+INSERT
|
2020-12-14 19:18:55 +00:00
|
|
|
Paste text (uses the primary selection on X11 and Wayland).
|
2019-12-07 16:16:10 +00:00
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
TAB and Ctrl+i
|
2023-11-25 17:30:49 +00:00
|
|
|
Complete the text at the cursor. The first press inserts the longest common
|
|
|
|
prefix of the completions, and subsequent presses cycle through them.
|
|
|
|
|
|
|
|
Shift+TAB
|
|
|
|
Cycle through the completions backwards.
|
2019-12-07 16:16:10 +00:00
|
|
|
|
2023-11-05 05:36:09 +00:00
|
|
|
Ctrl+l
|
2019-12-07 16:16:10 +00:00
|
|
|
Clear all log messages from the console.
|
|
|
|
|
2024-10-16 15:02:00 +00:00
|
|
|
MBTN_RIGHT
|
|
|
|
Hide the console.
|
|
|
|
|
|
|
|
MBTN_MID
|
|
|
|
Paste text (uses the primary selection on X11 and Wayland).
|
|
|
|
|
|
|
|
WHEEL_UP
|
|
|
|
Move back in the command history.
|
|
|
|
|
|
|
|
WHEEL_DOWN
|
|
|
|
Move forward in the command history.
|
|
|
|
|
2019-12-07 16:16:10 +00:00
|
|
|
Commands
|
|
|
|
--------
|
|
|
|
|
2020-03-27 13:46:39 +00:00
|
|
|
``script-message-to console type <text> [<cursor_pos>]``
|
|
|
|
Show the console and pre-fill it with the provided text, optionally
|
|
|
|
specifying the initial cursor position as a positive integer starting from
|
|
|
|
1.
|
|
|
|
|
2023-11-02 12:16:53 +00:00
|
|
|
.. admonition:: Examples for input.conf
|
2020-03-27 13:46:39 +00:00
|
|
|
|
2023-11-02 12:16:53 +00:00
|
|
|
``% script-message-to console type "seek absolute-percent; keypress ESC" 6``
|
|
|
|
Enter a percent position to seek to and close the console.
|
|
|
|
|
|
|
|
``Ctrl+o script-message-to console type "loadfile ''; keypress ESC" 11``
|
|
|
|
Enter a file or URL to play. Tab completes paths in the filesystem.
|
2019-12-07 16:16:10 +00:00
|
|
|
|
|
|
|
Known issues
|
|
|
|
------------
|
|
|
|
|
|
|
|
- Pasting text is slow on Windows
|
|
|
|
- Non-ASCII keyboard input has restrictions
|
|
|
|
- The cursor keys move between Unicode code-points, not grapheme clusters
|
|
|
|
|
|
|
|
Configuration
|
|
|
|
-------------
|
|
|
|
|
|
|
|
This script can be customized through a config file ``script-opts/console.conf``
|
|
|
|
placed in mpv's user directory and through the ``--script-opts`` command-line
|
2024-04-20 14:16:53 +00:00
|
|
|
option. The configuration syntax is described in `mp.options functions`_.
|
2019-12-07 16:16:10 +00:00
|
|
|
|
|
|
|
Key bindings can be changed in a standard way, see for example stats.lua
|
|
|
|
documentation.
|
|
|
|
|
|
|
|
Configurable Options
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
``font``
|
|
|
|
Default: unset (picks a hardcoded font depending on detected platform)
|
|
|
|
|
2022-06-20 21:26:33 +00:00
|
|
|
Set the font used for the REPL and the console.
|
|
|
|
This has to be a monospaced font for the completion suggestions to be
|
|
|
|
aligned correctly.
|
2019-12-07 16:16:10 +00:00
|
|
|
|
|
|
|
``font_size``
|
|
|
|
Default: 16
|
|
|
|
|
|
|
|
Set the font size used for the REPL and the console. This will be
|
2024-06-27 10:22:31 +00:00
|
|
|
multiplied by ``display-hidpi-scale``.
|
2022-06-18 01:29:32 +00:00
|
|
|
|
2023-03-11 10:25:26 +00:00
|
|
|
``border_size``
|
|
|
|
Default: 1
|
|
|
|
|
|
|
|
Set the font border size used for the REPL and the console.
|
|
|
|
|
2023-11-29 18:14:47 +00:00
|
|
|
``case_sensitive``
|
|
|
|
Default: no on Windows, yes on other platforms.
|
|
|
|
|
|
|
|
Whether Tab completion is case sensitive. Only works with ASCII characters.
|
|
|
|
|
2022-06-18 01:29:32 +00:00
|
|
|
``history_dedup``
|
|
|
|
Default: true
|
|
|
|
|
|
|
|
Remove duplicate entries in history as to only keep the latest one.
|
2022-06-20 21:26:33 +00:00
|
|
|
|
|
|
|
``font_hw_ratio``
|
2023-11-07 23:03:48 +00:00
|
|
|
Default: auto
|
2022-06-20 21:26:33 +00:00
|
|
|
|
|
|
|
The ratio of font height to font width.
|
|
|
|
Adjusts table width of completion suggestions.
|
2023-11-07 23:03:48 +00:00
|
|
|
Values in the range 1.8..2.5 make sense for common monospace fonts.
|