We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ae634a commit 87af330Copy full SHA for 87af330
lib/elixir/lib/io/ansi.ex
@@ -37,7 +37,14 @@ defmodule IO.ANSI do
37
"""
38
@spec terminal? :: boolean
39
def terminal?(device // :erlang.group_leader) do
40
- match?({:ok, _}, :io.columns(device))
+ if :erlang.system_info(:otp_release) < 'R16' and
41
+ Process.whereis(:user) != device do
42
+ # Shell prior to R16 doesn't support ANSI escape
43
+ # sequences
44
+ false
45
+ else
46
+ match?({:ok, _}, :io.columns(device))
47
+ end
48
end
49
50
@doc "Resets all attributes"
0 commit comments