anchor.diff:  	{io_request,From,ReplyAs,Req} when is_pid(From) ->
               %% This io_request may cause a transition to a couple of
               %% selective receive loops elsewhere in this module.
  -            Buf = io_request(Req, From, ReplyAs, Drv, Buf0),
  +            Buf = io_request(Req, From, ReplyAs, Drv, Shell, Buf0),
               server_loop(Drv, Shell, Buf);
           {reply,{{From,ReplyAs},Reply}} ->
               io_reply(From, ReplyAs, Reply),
  
positive.code: 	    {exit, terminated}
      end.
  
  get_chars_n(Prompt, M, F, Xa, Drv, Buf, Encoding) ->
      Pbs = prompt_bytes(Prompt, Encoding),
      case get(echo) of
          true ->
              get_chars_loop(Pbs, M, F, Xa, Drv, Buf, start, Encoding);
          false ->
              get_chars_n_loop(Pbs, M, F, Xa, Drv, Buf, start, Encoding)
      end.
  
  get_chars_line(Prompt, M, F, Xa, Drv, Buf, Encoding) ->
      Pbs = prompt_bytes(Prompt, Encoding),
      get_chars_loop(Pbs, M, F, Xa, Drv, Buf, start, Encoding).
  
  get_chars_loop(Pbs, M, F, Xa, Drv, Buf0, State, Encoding) ->
      Result = case get(echo) of
  		 true ->
  		     get_line(Buf0, Pbs, Drv, Encoding);
  		 false ->
  		     % get_line_echo_off only deals with lists
  		     % and does not need encoding...
  		     get_line_echo_off(Buf0, Pbs, Drv)
  	     end,
      case Result of
  	{done,Line,Buf} ->
              get_chars_apply(Pbs, M, F, Xa, Drv, Buf, State, Line, Encoding);
  	interrupted ->
  	    {error,{error,interrupted},[]};
  	terminated ->
  	    {exit,terminated}
      end.
  
  get_chars_apply(Pbs, M, F, Xa, Drv, Buf, State0, Line, Encoding) ->
      case catch M:F(State0, cast(Line,get(read_mode), Encoding), Encoding, Xa) of
          {stop,Result,Rest} ->
              {ok,Result,append(Rest, Buf, Encoding)};
          {'EXIT',_} ->
              {error,{error,err_func(M, F, Xa)},[]};
          State1 ->
              get_chars_loop(Pbs, M, F, Xa, Drv, Buf, State1, Encoding)
      end.
  
  get_chars_n_loop(Pbs, M, F, Xa, Drv, Buf0, State, Encoding) ->
      try M:F(State, cast(Buf0, get(read_mode), Encoding), Encoding, Xa) of
          {stop,Result,Rest} ->
              {ok, Result, Rest};
          State1 ->
              case get_chars_echo_off(Pbs, Drv) of
                  interrupted ->
                      {error,{error,interrupted},[]};
                  terminated ->
                      {exit,terminated};
                  Buf ->
                      get_chars_n_loop(Pbs, M, F, Xa, Drv, Buf, State1, Encoding)
              end
      catch _:_ ->
              {error,{error,err_func(M, F, Xa)},[]}
  
negative.code: 	    end
      end;
  
  io_request({get_chars,Encoding,Prompt,N}, Drv, Shell, _From, Buf) ->
      get_chars_n(Prompt, io_lib, collect_chars, N, Drv, Shell, Buf, Encoding);
  io_request({get_line,Encoding,Prompt}, Drv, Shell, _From, Buf) ->
      get_chars_line(Prompt, io_lib, collect_line, [], Drv, Shell, Buf, Encoding);
  io_request({get_until,Encoding, Prompt,M,F,As}, Drv, Shell, _From, Buf) ->
      get_chars_line(Prompt, io_lib, get_until, {M,F,As}, Drv, Shell, Buf, Encoding);
  io_request({get_password,_Encoding},Drv,Shell,_From,Buf) ->
      get_password_chars(Drv, Shell, Buf);
  io_request({setopts,Opts}, Drv, _Shell, _From, Buf) when is_list(Opts) ->
      setopts(Opts, Drv, Buf);
  io_request(getopts, Drv, _Shell, _From, Buf) ->
      getopts(Drv, Buf);
  io_request({requests,Reqs}, Drv, Shell, From, Buf) ->
      io_requests(Reqs, {ok,ok,Buf}, From, Drv, Shell);
  
  %% New in R12
  io_request({get_geometry,columns},Drv,_Shell,_From,Buf) ->
      case get_tty_geometry(Drv) of
  	{W,_H} ->
  	    {ok,W,Buf};
  	_ ->
  	    {error,{error,enotsup},Buf}
      end;
  io_request({get_geometry,rows},Drv,_Shell,_From,Buf) ->
      case get_tty_geometry(Drv) of
  	{_W,H} ->
  	    {ok,H,Buf};
  