Colorize typing into iex shell

Viewed 75

Is it possible to colorize typing into elixir interactive shell (iex) ?

iex [21:13 :: 2] > quote do: 1 + 2
{:+, [context: Elixir, import: Kernel], [1, 2]}

So, this part

quote do: 1 + 2

is always white (I cannot set different color for quote or do:). All others can be colored using .iex.exs config file.

2 Answers

Neither Elixir nor Erlang shell support colouring dynamic input, so what you want to achieve is not possible with current implementation.

I know this is an old question, but I'll post this anyway for folks from the future.

iex> Application.put_env(:elixir, :ansi_enabled, true) // turn colors ON
// OR
iex> Application.put_env(:elixir, :ansi_enabled, false) // turn colors OFF
Related