Skip to content

Commit 1d29262

Browse files
author
José Valim
committed
Check for terminal on both stdout and stderr
1 parent 1d655fa commit 1d29262

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

bin/elixir

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ if [ "$OSTYPE" = "cygwin" ]; then SCRIPT_PATH=$(cygpath -m $SCRIPT_PATH); fi
8585
if [ "$MODE" != "iex" ]; then ERL="-noshell -s elixir start_cli $ERL"; fi
8686

8787
# Check for terminal support
88-
test -t 1
89-
if [ $? = 0 ]; then ERL="-elixir ansi_enabled true $ERL"; fi
88+
if test -t 1 -a -t 2; then ERL="-elixir ansi_enabled true $ERL"; fi
9089

9190
if [ -z "$ERL_PATH" ]; then
9291
if [ -f "$SCRIPT_PATH/../releases/RELEASES" ] && [ -f "$SCRIPT_PATH/erl" ]; then

lib/elixir/lib/io/ansi.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ defmodule IO.ANSI do
3434
This function simply reads the configuration value for
3535
`:ansi_enabled` in the `:elixir` application. The value is by
3636
default false unless Elixir can detect during startup that
37-
`stdout` is a terminal.
37+
both `stdout` and `stderr` are terminals.
3838
"""
3939
@spec enabled? :: boolean
4040
def enabled? do

0 commit comments

Comments
 (0)