Strange behaviour of REPL with EOT signal

Hi there !

Here a minimal code :

function test()
    i = 1 
    while true
        println("Input expected (n°$i)")
        readline(stdin)
        i+=1
    end 
end

main() = test()

Then I run main() in the julia> prompt (launched with julia -i test.jl). And now I run Ctrl+D. And from now, no readline makes waiting the infinite loop :

$> julia -i infinite.jl
              _
  _       _ _(_)_     |  Documentation: https://docs.julialang.org
 (_)     | (_) (_)    |
  _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
 | | | | | | |/ _` |  |
 | | |_| | | | (_| |  |  Version 1.4.2 (2020-05-23)
_/ |\__'_|_|_|\__'_|  |  
|__/                   |

julia> main()
Input expected (n°1)
Input expected (n°2)
Input expected (n°3)
Input expected (n°4)
Input expected (n°5)
Input expected (n°6)
Input expected (n°7)
Input expected (n°8)
Input expected (n°9)
Input expected (n°10)

Why ? I expected one of these behaviours :

  • Stopping of julia REPL
  • Stopping of ONE of the readline

What happens ?