PythonCall.jl icon indicating copy to clipboard operation
PythonCall.jl copied to clipboard

Width & height info of the terminal is not passed to the Julia side?

Open findmyway opened this issue 3 years ago • 2 comments

When displaying some custom julia struct in IPython, the string output is wrapped. But when I try jl.display instead, the struct is displayed correctly as expected.

I'm wondering what we can do to make the printing work as the same in Julia REPL.

findmyway avatar Sep 06 '22 04:09 findmyway

I've thought about this before and AFAIK there is no generic method to get the display size of a Python file object, so this can't be solved in general.

However, as a special case, we could check if the file object is actually stdout or stderr, and if so use its display size.

cjdoris avatar Sep 06 '22 18:09 cjdoris

Actually I'm not sure what you mean. Can you give me an example?

cjdoris avatar Sep 09 '22 17:09 cjdoris