Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It shows repeated output in VScode #231

Closed
albertomercurio opened this issue Feb 21, 2022 · 13 comments
Closed

It shows repeated output in VScode #231

albertomercurio opened this issue Feb 21, 2022 · 13 comments

Comments

@albertomercurio
Copy link

Hello,

if I try to run the following script, it shows a repeated output.

p = Progress(10)
for i in 1:10
    sleep(0.5)
    next!(p)
end
Progress:  20%|████████▎                                |  ETA: 0:00:04
Progress:  30%|████████████▎                            |  ETA: 0:00:04
Progress:  40%|████████████████▍                        |  ETA: 0:00:03
Progress:  50%|████████████████████▌                    |  ETA: 0:00:03
Progress:  60%|████████████████████████▋                |  ETA: 0:00:02
Progress:  70%|████████████████████████████▊            |  ETA: 0:00:02
Progress:  80%|████████████████████████████████▊        |  ETA: 0:00:01
Progress:  90%|████████████████████████████████████▉    |  ETA: 0:00:01
Progress: 100%|█████████████████████████████████████████| Time: 0:00:05
@fpartl
Copy link

fpartl commented Mar 28, 2022

Hello, I have the same issue with the version 1.7.2.
obrazek

@oschulz
Copy link

oschulz commented Apr 10, 2023

Just ran into this as well. :-)

@timholy
Copy link
Owner

timholy commented Apr 10, 2023

I'd merge a PR that fixes it, if you care to submit one.

@oschulz
Copy link

oschulz commented Apr 10, 2023

No idea why this happens, but I can play around a bit.

@mofeing
Copy link

mofeing commented Jul 17, 2023

There is an open issue about this in microsoft/vscode#200261. Apparently there was a similar bug in Python microsoft/vscode#146397.

@BenjaminDoran
Copy link

Issue seems to be dependent on which kernel is selected. i.e. using a jupyter kernel (that loads IJulia) works. using the default kernel from the julia vscode extension doesn't.

some of this is from the CLEAR_IJULIA[] checking isdefined(Main, :IJulia) && Main.IJulia.inited

We can check if we are in the default vscode notebook context with:

# true if in vscode notebook
running_vscode_kernel() = isdefined(Main, :VSCodeServer) && !isinteractive() 

but I don't know of how to flush clear the output cell, when IJulia is not loaded

@3f6a
Copy link

3f6a commented Aug 3, 2023

See #271

@affans
Copy link

affans commented Dec 22, 2023

Has there been any update to this? A manual fix for now or an alternative? I am using the default vscode extension kernel.

@MarcMush
Copy link
Collaborator

an equivalent to IJulia.clear_output() would be needed (julia-vscode/julia-vscode#2473)

@oschulz
Copy link

oschulz commented Dec 23, 2023

How do Python VS-Code notebooks handle such things?

@oameye
Copy link

oameye commented Feb 25, 2024

Issue seems to be dependent on which kernel is selected. i.e. using a jupyter kernel (that loads IJulia) works. using the default kernel from the julia vscode extension doesn't.

I can confirm this

@davidanthoff
Copy link

I just released a new version of the extension that should improve the situation a bit. At least for simple one-line progress bar I think it should all work now.

@oameye
Copy link

oameye commented Jul 13, 2024

I think this can be closed. It works for me in julia v1.11, ProgressMeter v1.10.0 and julia-vscode v1.90.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests