anchor.diff:  %% io_request(Request, InPort, OutPort)
   %% io_requests(Requests, InPort, OutPort)
   %% Note: InPort is unused.
  -io_request({requests,Rs}, Iport, Oport) ->
  -    io_requests(Rs, Iport, Oport);
  -io_request(Request, _Iport, Oport) ->
  +io_request({requests,Rs}, Port) ->
  +    io_requests(Rs, Port);
  +io_request(Request, Port) ->
       case io_command(Request) of
           {Data, Reply} ->
  -            true = port_command(Oport, Data),
  +            true = port_command(Port, Data),
               Reply;
           unhandled ->
               ok
       end.
   
  -io_requests([R|Rs], Iport, Oport) ->
  -    io_request(R, Iport, Oport),
  -    io_requests(Rs, Iport, Oport);
  -io_requests([], _Iport, _Oport) ->
  +io_requests([R|Rs], Port) ->
  +    io_request(R, Port),
  +    io_requests(Rs, Port);
  +io_requests([], _Port) ->
       ok.
   
   put_int16(N, Tail) ->
  
positive.code:                     end,
  
  		RShell = {ANode,shell,start,[]},
  		RGr = group:start(self(), RShell, rem_sh_opts(ANode)),
  		{RGr,RShell};
  	    E when E =:= error ; E =:= {ok,[[]]} ->
  		{group:start(self(), Shell),Shell}
  	end,
  
      Gr = gr_add_cur(Gr1, Curr, Shell1),
      %% Print some information.
      io_request({put_chars, unicode,
  		flatten(io_lib:format("~ts\n",
  				      [erlang:system_info(system_version)]))},
  	       Iport, Oport),
  
      %% Enter the server loop.
      server_loop(Iport, Oport, Curr, User, Gr, {false, queue:new()}).
  
  append_hostname(Node, LocalNode) ->
      case string:find(Node,"@") of
  
negative.code: -module(user_drv).
  
  %% Basic interface to a port.
  %%
  %% This is responsible for a couple of things:
  %%   - Dispatching I/O messages when erl is running as a terminal.
  %%     The messages are listed in the type message/0.
  %%   - Any data received from the terminal is sent to the current group like this:
  %%     `{DrvPid :: pid(), {data, UnicodeBinary :: binary()}}`
  %%   - It serves as the job control manager (i.e. what happens when you type ^G)
  %%   - Starts potential -remsh sessions to other nodes
  %%
  -type message() ::
          %% I/O requests that modify the terminal
          {Sender :: pid(), request()} |
          %% Query the server of the current dimensions of the terminal.
          %% `Sender` will be sent the message:
          %%   `{DrvPid :: pid(), tty_geometry, {Width :: integer(), Height :: integer()}}`
          {Sender :: pid(), tty_geometry} |
          %% Query the server if it supports unicode characters
          %% `Sender` will be sent the message:
          %%   `{DrvPid :: pid(), get_unicode_state, SupportUnicode :: boolean()}`
          {Sender :: pid(), get_unicode_state} |
          %% Change whether the server supports unicode characters or not. The reply
          %% contains the previous unicode state.
          %% `Sender` will be sent the message:
          %%   `{DrvPid :: pid(), set_unicode_state, SupportedUnicode :: boolean()}`
          {Sender :: pid(), set_unicode_state, boolean()}.
  -type request() ::
          %% Put characters at current cursor position,
          %% overwriting any characters it encounters.
          {put_chars, unicode, binary()} |
          %% Same as put_chars/3, but sends Reply to From when the characters are
          %% guaranteed to have been written to the terminal
          {put_chars_sync, unicode, binary(), {From :: pid(), Reply :: term()}} |
          %% Move the cursor X characters left or right (negative is left)
          {move_rel, -32768..32767} |
          %% Insert characters at current cursor position moving any
          %% characters after the cursor.
          {insert_chars, unicode, binary()} |
          %% Delete X chars before or after the cursor adjusting any test remaining
          %% to the right of the cursor.
          {delete_chars, -32768..32767} |
          %% Trigger a terminal "bell"
          beep |
          %% Execute multiple request() actions
          {requests, [request()]}.
  
  -export_type([message/0]).
  -export([start/0, start/1]).
  
  %% gen_statem state callbacks
  -export([init/3,server/3,switch_loop/3]).
  
  %% gen_statem callbacks
  -export([init/1, callback_mode/0]).
  
  -include_lib("kernel/include/logger.hrl").
  
  