[erlang-bugs] bug in terminal io

Robert Virding rvirding@REDACTED
Fri Mar 21 15:45:07 CET 2014


In the test1 case do you get the shell prompt? Or nothing?

If you get the shell prompt what happens when you enter a new shell
command? Do you then see the 'enter a term> ' prompt? Or just see a new
shell prompt?

Robert



On 13 March 2014 14:04, Joe Armstrong <erlang@REDACTED> wrote:

> %% 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
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140321/fea695c7/attachment.htm>


More information about the erlang-bugs mailing list