anchor.diff:      erlang:port_close(State#state.port),
       erl_ddll:unload("cecho").
   
  -handle_info({getch, From}, #state{ getpid = undefined } = State) ->
  -    {noreply, State#state{ getpid = From }};
  -handle_info({getch, From}, State) ->
  -    exit(From, kill),
  -    {noreply, State};
  -handle_info({_Port, {data, _Binary}}, #state{ getpid = undefined } = State) ->
  +handle_info({_Port, {data, _Binary}}, #state{ getch = undefined } = State) ->
       {noreply, State};
   handle_info({_Port, {data, Binary}}, State) ->
  -    Ch = binary_to_term(Binary),
  -    State#state.getpid ! {ch, Ch},
  -    {noreply, State#state{ getpid = undefined }}.
  +    gen_server:reply(State#state.getch, binary_to_term(Binary)),
  +    {noreply, State#state{ getch = undefined }}.
   
   %% @hidden
   handle_cast(_, State) ->
  
positive.code:     gen_server:call(?MODULE, {call, Cmd, Args}, infinity).
  
  getch() ->
      ?MODULE ! {getch, self()},
      receive 
  	{ch, Chr} ->
  	    Chr
      end.
  
  %% =============================================================================
  %% Behaviour Callbacks
  
negative.code:     end.
  
  handle_call({call, Cmd, Args}, _From, State) ->
      {reply, do_call(State#state.port, Cmd, Args), State};
  handle_call(getch, From, #state{ getch = undefined } = State) ->
      {noreply, State#state{ getch = From }};
  handle_call(getch, _From, State) ->
      {reply, -1, State}.
  
  terminate(_Reason, State) ->
      do_call(State#state.port, ?ENDWIN),
  