Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
725 views
in Technique[技术] by (71.8m points)

elixir - How to make custom prompt take effect at iex start?

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
)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...