-
Notifications
You must be signed in to change notification settings - Fork 3.2k
DOCS/man/lua: suggest keep_open for nested mp.input calls #17252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Before mpv-player#17251 keep_open was needed to make nested mp.input calls. Even after that change it is still better to pass it to not show console quickly closing and reopening to the user, so recommend it.
d59ef46 to
3a394bb
Compare
CogentRedTester
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that there are some fundamental concepts that have not been explained in the current documentation, namely:
- That this is an asynchronous API.
- That only one request can be active at a time (shared between all clients)
- That if a new request is received while another is active, then usually the old request will be closed and the new one will be shown instead.
- That
input.selectuses the same backend asinput.getand so they cannot be active at the same time. - That
input.terminate()and the log methods apply to whichever input happens to be active, even ones created by other scripts.
If we want to leave open the possibility of requests not always overriding each other in the future, then we could add a statement like "a way to prevent a request from being overridden may be added in the future, use opened to guarantee that an input request has been opened".
| Whether to keep the console open on submit. Defaults to ``false``. | ||
|
|
||
| It is recommended to set this to ``true`` when nesting ``input.get()`` | ||
| or ``input.select()`` calls to avoid showing the console quickly closing | ||
| and reopening. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth being a little more specific. Someone reading this for the first time probably has no idea what 'nesting' means.
| Whether to keep the console open on submit. Defaults to ``false``. | |
| It is recommended to set this to ``true`` when nesting ``input.get()`` | |
| or ``input.select()`` calls to avoid showing the console quickly closing | |
| and reopening. | |
| Whether to keep the console open on submit, allowing further | |
| input. Defaults to ``false``. | |
| If calling ``input.get()`` or ``input.select()`` again from inside the | |
| ``submit`` callback, setting this option to ``true`` allows a seamless | |
| transition without the console closing and reopening. |
| Whether to keep the console open on submit. Defaults to ``false``. | ||
|
|
||
| It is recommended to set this to ``true`` when nesting ``input.get()`` | ||
| or ``input.select()`` calls to avoid showing the console quickly closing | ||
| and reopening. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Whether to keep the console open on submit. Defaults to ``false``. | |
| It is recommended to set this to ``true`` when nesting ``input.get()`` | |
| or ``input.select()`` calls to avoid showing the console quickly closing | |
| and reopening. | |
| Whether to keep the console open on submit, allowing further | |
| input. Defaults to ``false``. | |
| If calling ``input.get()`` or ``input.select()`` again from inside the | |
| ``submit`` callback, setting this option to ``true`` allows a seamless | |
| transition without the console closing and reopening. |
|
Do you just want to take over in a new PR since you already have clear ideas of what to change?
Not sure what the use case for this would be though, it would just be reverting to the previous behavior. |
|
Could probably do it as part of #17256 if there's interest in any of the changes suggested in there. We'd then be able to update the documentation with guarantees about when things run.
I just thought there might theoretically be a desire to specify an input request that cannot be overridden by new ones (if its for something theoretically important like a password prompt for a network file). If we explicitly guarantee in the documentation that all new requests will override old ones, then something like that isn't really possible in the future without breaking things. But, if we didn't guarantee that, and instead state that the To be clear I'm not advocating for adding that kind of "high-priority" prompt, I just thought it might be worth keeping the option open since it's just a matter of wording in the documentation. |
Before #17251 keep_open was needed to make nested mp.input calls. Even after that change it is still better to pass it to not show console quickly closing and reopening to the user, so recommend it.
Depends on #17251.