anchor.diff:      file:del_dir_r(Tempdir),
       Logs.
   
  +rtstop_try_harder(ToErl, Tempdir) ->
  +    CPid = start_toerl_server(ToErl, Tempdir),
  +    ok = send_commands(CPid,
  +                       [{putline,[7]},
  +                        {expect, " --> $"},
  +                        {putline, "s"},
  +                        {putline, "c"},
  +                        {putline, ""}], 1),
  +    stop_runerl_node(CPid).
  +
  +timeout(longest) ->
  +    timeout(long) + timeout(normal);
   timeout(long) ->
       2 * timeout(normal);
   timeout(short) ->
  
positive.code:         {ok, Logs1} =
              rtnode([
                      {putline, "echo."},
                      {getline, "echo"}
                     ], [], [], "-kernel shell_history enabled " ++ mk_sh_param(Path)),
  
          rtnode_check_logs("erlang.log.1", "Error handling file", Logs1),
  
negative.code: 
  %% Test that the shell can access columns and rows.
  get_columns_and_rows(Config) when is_list(Config) ->
      case proplists:get_value(default_shell, Config) of
  	old ->
              test_columns_and_rows(old, []);
  	new ->
              test_columns_and_rows(old, ["-oldshell"]),
              test_columns_and_rows(new, [])
      end,
      ok.
  
  test_columns_and_rows(old, Args) ->
      rtnode([{putline, ""},
              {putline, "2."},
              {expect, "2\r\n"},
              {putline, "io:columns()."},
              {expect, "{error,enotsup}\r\n"},
              {putline, "io:rows()."},
              {expect, "{error,enotsup}\r\n"}
             ], [], [], Args),
  
      rtnode([{putline, ""},
              {putline, "2."},
              {expect, "2\r\n"},
              {putline, "io:columns()."},
              {expect, "{ok,90}\r\n"},
              {putline,"io:rows()."},
              {expect, "{ok,40}\r\n"}],
             [],
             "stty rows 40; stty columns 90; ",
             Args);
  test_columns_and_rows(new, _Args) ->
      rtnode([{putline, ""},
              {expect, "1> $"},
              {putline, "2."},
              {expect, "\r\n2\r\n"},
              {expect, "> $"},
              {putline, "io:columns()."},
              {expect, "{ok,80}\r\n"},
              {expect, "> $"},
              {putline, "io:rows()."},
              {expect, "\r\n{ok,24}\r\n"}
             ]),
  
      rtnode([{putline, ""},
              {expect, "1> $"},
              {putline, "2."},
              {expect,  "\r\n2\r\n"},
              {expect, "> $"},
              {putline, "io:columns()."},
              {expect, "\r\n{ok,90}\r\n"},
              {expect, "> $"},
              {putline, "io:rows()."},
              {expect, "\r\n{ok,40}\r\n"}],
             [],
             "stty rows 40; stty columns 90; ").
  
  %% Tests that exit of initial shell restarts shell.
  exit_initial(Config) when is_list(Config) ->
      case proplists:get_value(default_shell, Config) of
  	old ->
              test_exit_initial(old);
          new ->
              test_exit_initial(old),
              test_exit_initial(new)
      end,
      ok.
  
  test_exit_initial(old) ->
      rtnode([{putline, ""},
              {putline, "2."},
              {expect, "2\r\n"},
              {putline, "exit()."},
              {expect, "Eshell"},
              {putline, ""},
              {putline, "35."},
              {expect, "35\r\n"}],
             [], [], ["-oldshell"]);
  test_exit_initial(new) ->
      rtnode([{putline, ""},
              {expect, "1> $"},
              {putline, "2."},
              {expect, "2"},
              {putline,"exit()."},
              {expect, "Eshell"},
              {expect, "1> $"},
              {putline, "35."},
              {expect, "35\r\n"}]).
  
  stop_during_init(Config) when is_list(Config) ->
      {RunErl,_ToErl,Erl} = get_progs(),
      case create_tempdir() of
          {error, Reason} ->
              {skip, Reason};
          Tempdir ->
              XArg = " -kernel shell_history enabled -s init stop",
              start_runerl_command(RunErl, Tempdir, "\\\""++Erl++"\\\""++XArg),
              Logs = rtnode_read_logs(Tempdir),
              rtnode_dump_logs(Logs),
              nomatch = binary:match(map_get("erlang.log.1", Logs),
                                     <<"*** ERROR: Shell process terminated! ***">>),
              ok
      end.
  
  %% This testcase tests that shell_history works as it should.
  %% We use Ctrl + P = Cp=[$\^p] in order to navigate up
  