mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-23 19:30:20 +00:00
commands.lua: split this script out of console.lua
It was suggested by CogentRedTester in https://github.com/mpv-player/mpv/pull/10282#issuecomment-1858727729 and https://github.com/mpv-player/mpv/pull/10282#issuecomment-1858809580 and by avih that making running commands an mp.input client is a better architecture. A practical advantage is that completions are calculated in a different thread, which prevents hanging when completing slow/network filesystems. script-binding console/enable becomes script-binding commands/open, though the console one is kept as an alias. I took the opportunity to rename this because open makes more sense for a graphical modal, and it is the word used in mp.input and user-data. script-message-to console type becomes script-message-to commands type, though the console one is kept as an alias. It is also changed to automatically close on submit without having to append '; keypress ESC' as you don't need to keep the console open after running prefilled commands. Also convert to double quotes like other scripts and rename some inconsistent functions.
This commit is contained in:
@@ -444,7 +444,7 @@ typedef struct MPContext {
|
||||
|
||||
struct mp_ipc_ctx *ipc_ctx;
|
||||
|
||||
int64_t builtin_script_ids[7];
|
||||
int64_t builtin_script_ids[8];
|
||||
|
||||
mp_mutex abort_lock;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user