How to make custom prompt take effect at iex start?
Asked Answered
K

1

7

I have a custom prompt but when I launch iex, a builtin prompt shows. After I hit enter my prompt takes effect. How can I make my prompt take effect when iex starts?

Here's what I'm seeing:

enter image description here

And this is my .iex.exs file:

IEx.configure(
  colors: [ enabled: true],
  default_prompt: [
      "\e[G",   # move to column 1
      "\e[35m", # magenta
      "MY %prefix(%counter)",
      ">",
      "\e[0m"   # reset
    ] |> IO.chardata_to_string
)
Kliment answered 22/6, 2016 at 17:15 Comment(2)
I guess it's a bug. What version of iex do you have?Gardner
1.3.0 (as shown in the screenshot) this behavior existed in previous versions too.Kliment
T
3

It's a bug in iex. I've tracked down and fixed it: https://github.com/elixir-lang/elixir/pull/4895

Tameika answered 27/6, 2016 at 7:24 Comment(1)
Thanks so much for finding and fixing the bug. And thanks to @JoséValim for reviewing and accepting your PR so quickly!Kliment

© 2022 - 2024 — McMap. All rights reserved.