summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2020-04-23 16:29:18 +0300
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2020-04-23 17:02:38 +0300
commit5ff215c4df5c635b1ac3b39ab30be4760a070834 (patch)
tree2ae0526b15d7888322510af0ad1a7df2201631f9
parent1c8506d9c8e43b899b9e7eb7e325c04758dc847f (diff)
downloadmpv-5ff215c4df5c635b1ac3b39ab30be4760a070834.tar.bz2
mpv-5ff215c4df5c635b1ac3b39ab30be4760a070834.tar.xz
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.
-rw-r--r--player/lua/stats.lua26
1 files changed, 4 insertions, 22 deletions
diff --git a/player/lua/stats.lua b/player/lua/stats.lua
index e76c496668..8e1940d75f 100644
--- a/player/lua/stats.lua
+++ b/player/lua/stats.lua
@@ -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