JuliaPluto / PlutoUI.jl

https://featured.plutojl.org/basic/plutoui.jl
The Unlicense
299 stars 54 forks source link

`with_terminal` does not capture `CSV.write` output #155

Open yha opened 2 years ago

yha commented 2 years ago
with_terminal() do
    CSV.write(stdout, DataFrame(x=[1,2,3],y=[2,3,4]))
end

output is shown in the terminal which launched Pluto, and not inside the notebook: image

jonas-schulze commented 2 years ago

I encountered the same problem with Pluto v0.17.1. Using a plain println works fine, specifying stdout causes the same effect described above:

Bildschirmfoto 2022-02-25 um 15 53 53

together with

      From worker 2:    foo

in the terminal that launched Pluto.

I didn't check whether the problem still exists in the most recent version of Pluto (v0.18.1), though. Is there any progress on this? Working with Pluto is really fun, btw!

likanzhan commented 2 years ago

Is there an update on this problem? I'm not sure whether it is related, but when I have a macro containing a println, the result is not printed either:

macro foo(e)
    println("In Foo")
    e
end
with_terminal() do
       foo(1)
end