Skip to content

Commit

Permalink
Print node name in IEx prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasc committed Jul 30, 2012
1 parent 1fe5cad commit 0252a4f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/elixir/lib/iex/unicode_io.ex
Expand Up @@ -11,11 +11,16 @@ defmodule IEx.UnicodeIO do
return a list with the new characters inserted.
"""
def get(config) do
prompt = case config.cache do
[] -> "iex(#{config.counter})> "
_ -> "...(#{config.counter})> "
prefix = case config.cache do
[] -> "iex"
_ -> "..."
end
prompt = case node do
:nonode@nohost ->
"#{prefix}(#{config.counter})> "
n ->
"#{prefix}(#{n})#{config.counter}> "
end

case IO.gets(prompt) do
{ :error, _ } -> ''
data -> :unicode.characters_to_list(data)
Expand All @@ -37,4 +42,4 @@ defmodule IEx.UnicodeIO do
def error(result) do
IO.puts :standard_error, result
end
end
end

0 comments on commit 0252a4f

Please sign in to comment.