console.lua: default prompt to an empty string

Calling input.select() without a prompt argument was failing due to
attempting to concatenate a nil value.

Before mpv 0.40 the prompt defaulted to ">" so this is expected to
work as evident from the example code.
This commit is contained in:
showergum
2025-04-11 23:45:17 -06:00
committed by Kacper Michajłow
parent 91337443ad
commit 44816ef8ff
+1 -1
View File
@@ -1554,7 +1554,7 @@ mp.register_script_message("get-input", function (script_name, args)
input_caller = script_name
args = utils.parse_json(args)
prompt = args.prompt
prompt = args.prompt or ""
line = args.default_text or ""
cursor = tonumber(args.cursor_position) or line:len() + 1
keep_open = args.keep_open