stats.lua: don't disable terminal escape sequences on windows

When stats.lua is used without a video window then it uses the terminal.
On Windows, however, so far it disabled ansi escape sequences and used
plaintext unless ANSICON env is set.

It's unclear why it's disabled on windows, because at the time it was
added it only used bold by default and mpv ansi emulation on windows
already supported bold at that time.

We can guess that it was disabled because if the same config is used on
both linux and Windows, and it had complex escape sequences for
stats.lue, then it would be emulated incorrectly on Windows.

This shouldn't be an issue anymore, as the last two commits both enhance
the emulation to be quite complete (and graceful where it's not), and
also enable the much-more complete native VT terminal when possible
(Windows 10).

Just remove this windows exception at stats.lua.
This commit is contained in:
Avi Halachmi (:avih) 2020-04-23 16:29:18 +03:00
parent 1c8506d9c8
commit 5ff215c4df
1 changed files with 4 additions and 22 deletions

View File

@ -176,17 +176,6 @@ local function has_vo_window()
end
local function has_ansi()
local is_windows = type(package) == 'table'
and type(package.config) == 'string'
and package.config:sub(1, 1) == '\\'
if is_windows then
return os.getenv("ANSICON")
end
return true
end
-- Generate a graph from the given values.
-- Returns an ASS formatted vector drawing as string.
--
@ -608,17 +597,10 @@ local function eval_ass_formatting()
o.nl = o.no_ass_nl
o.indent = o.no_ass_indent
o.prefix_sep = o.no_ass_prefix_sep
if not has_ansi() then
o.b1 = ""
o.b0 = ""
o.it1 = ""
o.it0 = ""
else
o.b1 = o.no_ass_b1
o.b0 = o.no_ass_b0
o.it1 = o.no_ass_it1
o.it0 = o.no_ass_it0
end
o.b1 = o.no_ass_b1
o.b0 = o.no_ass_b0
o.it1 = o.no_ass_it1
o.it0 = o.no_ass_it0
end
end