manrajgrover / halo

💫 Beautiful spinners for terminal, IPython and Jupyter
MIT License
2.9k stars 149 forks source link

Suggestion: Close widget box when clearing the spinner on jupyter notebook #175

Open guigoruiz1 opened 1 year ago

guigoruiz1 commented 1 year ago

Description

When using Halo in a Jupiter notebook, the widget leaves an object behind with non-zero height. This causes the output to be shifted down slightly every time a spinner is used. For example, if you try

print('test')
for i in tqdm(range(10),leave=False):
    with Halo() as spinner:
        time.sleep(0.5)

print('test')

you will see the second test way below the first rather than as second line.

A very easy fix for that is using spinner.output.close(), so I suggest adding that line to the clear function of the HaloNotebook object.

People to notify

@manrajgrover