[erlang-bugs] bug in terminal io

Joe Armstrong erlang@REDACTED
Thu Mar 13 14:04:41 CET 2014


%% There is a strange bug in the interaction of the shell with
%% terminal io.

%% If I run

%%  1> bug:test1().
%%  <0.46.0>

%% Then the prompt is not written out

%% If I add a timeout after the function it works
%% But only if I type a value in before ten seconds

%% 2> bug:test2().
%% enter a term >abc.
%% N={ok,abc}
%% true

%% But AFTER Typing a line the prompt is repeated and the prompt
%% vanishes after ten seconds

%% If I wait 10 seconds and don't type anything
%% the ' enter a term' prompt is written
%% and then *removed* after 10 seconds

%% If the command started in the shell terminates immediately

-module(bug).
-export([test1/0, test2/0]).

test1() ->
    spawn(fun() ->
  N = io:read(' enter a term >'),
  io:format("N=~p~n",[N])
  end).

test2() ->
    spawn(fun() ->
  N = io:read(' enter a term >'),
  io:format("N=~p~n",[N])
  end),
    receive
after 10000 ->
true
end.

/Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140313/28af7380/attachment.htm>


More information about the erlang-bugs mailing list