anchor.diff:  %%  of course, a 'user' already exists.
   
   start_user() ->
  -    case whereis(user_drv) of
  -	undefined ->
  -	    register(user_drv, self());
  -	_ ->
  -	    ok
  -    end,
       case whereis(user) of
   	undefined ->
   	    User = group:start(self(), {}),
  
positive.code: -define(CTRL_OP_GET_UNICODE_STATE, (101 + ?ERTS_TTYSL_DRV_CONTROL_MAGIC_NUMBER)).
  -define(CTRL_OP_SET_UNICODE_STATE, (102 + ?ERTS_TTYSL_DRV_CONTROL_MAGIC_NUMBER)).
  
  %% start()
  %% start(ArgumentList)
  %% start(PortName, Shell)
  %% start(InPortName, OutPortName, Shell)
  %%  Start the user driver server. The arguments to start/1 are slightly
  %%  strange as this may be called both at start up from the command line
  %%  and explicitly from other code.
  
  -spec start() -> pid().
  
  start() ->					%Default line editing shell
      spawn(user_drv, server, ['tty_sl -c -e',{shell,start,[init]}]).
  
  start([Pname]) ->
      spawn(user_drv, server, [Pname,{shell,start,[init]}]);
  start([Pname|Args]) ->
      spawn(user_drv, server, [Pname|Args]);
  start(Pname) ->
      spawn(user_drv, server, [Pname,{shell,start,[init]}]).
  
  start(Pname, Shell) ->
      spawn(user_drv, server, [Pname,Shell]).
  
  start(Iname, Oname, Shell) ->
      spawn(user_drv, server, [Iname,Oname,Shell]).
  
  %% server(Pid, Shell)
  %% server(Pname, Shell)
  %% server(Iname, Oname, Shell)
  %%  The initial calls to run the user driver. These start the port(s)
  %%  then call server1/3 to set everything else up.
  
  server(Pid, Shell) when is_pid(Pid) ->
      server1(Pid, Pid, Shell);
  server(Pname, Shell) ->
      process_flag(trap_exit, true),
      case catch open_port({spawn,Pname}, [eof]) of
  	{'EXIT', _} ->
  	    %% Let's try a dumb user instead
  	    user:start();
  	Port ->
  	    server1(Port, Port, Shell)
      end.
  
  server(Iname, Oname, Shell) ->
      process_flag(trap_exit, true),
      case catch open_port({spawn,Iname}, [eof]) of
  	{'EXIT', _} -> %% It might be a dumb terminal lets start dumb user
  	    user:start();
  	Iport ->
  	    Oport = open_port({spawn,Oname}, [eof]),
  	    server1(Iport, Oport, Shell)
      end.
  
  server1(Iport, Oport, Shell) ->
  
      Encoding =
          case get_unicode_state(Iport) of
              true -> unicode;
              false -> latin1
          end,
  
      %% Initialize standard_error
      ok = io:setopts(standard_error, [{encoding, Encoding}, {onlcr,true}]),
  
      put(eof, false),
      %% Start user and initial shell.
      User = start_user(),
      Gr1 = gr_add_cur(gr_new(), User, {}),
  
      {Curr,Shell1} =
  	case init:get_argument(remsh) of
  	    {ok,[[Node]]} ->
                  ANode =
  
negative.code:                     end,
  
  		RShell = {ANode,shell,start,[]},
  		{group:start(self(), RShell, rem_sh_opts(ANode)), RShell};
  	    E when E =:= error ; E =:= {ok,[[]]} ->
  		LShell = maps:get(initial_shell, Args, {shell,start,[init]}),
  		{group:start(self(), LShell), LShell}
  	end,
  
      Gr1 = gr_add_cur(gr_new(), User, {}),
      Gr = gr_add_cur(Gr1, Curr, Shell),
  
      NewState = State#state{ port = Port, current_group = Curr, user = User,
                              groups = Gr, queue = {false, queue:new()}
                            },
  
      %% Print some information.
      Slogan = case application:get_env(stdlib, shell_slogan,
                                        fun() -> erlang:system_info(system_version) end) of
                   Fun when is_function(Fun, 0) ->
                       Fun();
                   SloganEnv ->
                       SloganEnv
               end,
  
      {next_state, server, NewState,
       {next_event, info,
        {Curr, {put_chars, unicode, lists:flatten(io_lib:format("~ts\n", [Slogan]))}}}}.
  
  append_hostname(Node, LocalNode) ->
      case string:find(Node,"@") of
  