halo
halo copied to clipboard
Bug: Long texts length is not matching output area in Jupyter
Description
Currently, on using long texts with animations in Jupyter results in output wrapping in next line. Fix for this would be to give it a fixed layout width or try and get the width of display area while creating frames.
System settings
- Operating System: Mac OS
- Terminal in use: NA
- Python version: 2.7.14
- Halo version: HEAD
pip freezeoutput: NA
Error
Output wraps in display area for Jupyter notebook when long texts are used.
Expected behaviour
Output should take width of display area before creating frames.
Steps to recreate

People to notify
@JungWinter @ManrajGrover
@JungWinter Could you look into this?
I checked it occurred because of wrong get_terminal_size(). In jupyter, width of Output widget is not related with terminal size. But in HaloNotebook._get_text(), it use get_terminal_columns() via backports.shutil_get_terminal_size.get_terminal_size().
backports.shutil_get_terminal_size.get_terminal_size() decide terminal width using columns = int(os.environ["COLUMNS"]). But jupyter widget is independent with terminal size and related with HMTL/CSS. So I'm searching to get current jupyter cell's width and how to convert to ascii terminal size like 80, 120, etc.
@JungWinter That is correct. I was trying to find a way around this but I think there is no official way. I was thinking of injecting some javascript code to get actual width and converting it to terminal size.
@JungWinter I've made a release with Jupyter support for now. This issue is still not resolved and needs to be fixed (probably with a new approach).
Is this issue still open? I would like to work on this issue. Can you please assign this to me?
I think it's still happening. @manrajgrover Could you confirm ajjayymahato's request? (At least, #165 issue is also needed to check.)
If this issue is open can you please assign it to me so that I can work on it?