Note that this still is not perfect, because if osd message is changed, console cannot know about it and would still clear it, but this change make it at least not do it to every message even if console is not used.
Showing the changes to player/lua/console.lua (1 of 1 file). Show all
Unified · Split
| @@ -414,7 +414,9 @@ end · 413 unmodified lines | ||
| 414 | 414 | local function print_to_terminal() |
| 415 | 415 | -- Clear the log after closing the console. |
| 416 | 416 | if not repl_active then |
| 417 | − mp.osd_message('') | |
| 417 | + if osd_msg_active then | |
| 418 | + mp.osd_message('') | |
| 419 | + end | |
| 418 | 420 | osd_msg_active = false |
| 419 | 421 | return |
| 420 | 422 | end |