[erlang-patches] extend default_prompt to include remote shell node

Anton Fedorov <>
Thu Aug 9 09:18:01 CEST 2012


Replace shell.erl with:

default_prompt(N) ->
    %% Don't bother flattening the list irrespective of what the
    %% I/O-protocol states.
    case is_alive() of
    true  -> case {node(erlang:group_leader()), node()} of
                 {L,L} -> io_lib:format(<<"(~s)~w> ">>, [L, N]);
                 {R,L} -> io_lib:format(<<"[~s](~s)~w> ">>, [R, L])
             end;
    false -> io_lib:format(<<"~w> ">>, [N])
    end.

That will allow to distinguish when you connected locally and when you connected
remotely to node.

To prevent accidents with pressing Ctrl+C on local node, and running
erlang:halt() on remote.

-- 
Regards,
Anton Fedorov
Call2ru service
E-Mail: 
Jabber: 
Skype: datacompboy
ICQ: 272-35-262
Mobile: +7-913-925-7974 [SMS 24h, Call 05:00-19:00 MSKT (GMT+3)]



More information about the erlang-patches mailing list