Skip to content

Terminal size #2

@cebaa

Description

@cebaa

Awesome little project!

I assume this is not something that can be solved with this architecture, but just putting it out there in case there's a solution. Since terminal size is returned as (0, 0), it causes issues in some libraries that depend on it, e.g.:

$ cat j.py
import os
import polars

print(os.get_terminal_size())
print(polars.DataFrame(dict(j=['hello world'*50])))

$ python j.py
os.terminal_size(columns=237, lines=73)
shape: (1, 1)
┌─────────────────────────────────┐
│ j                               │
│ ---                             │
│ str                             │
╞═════════════════════════════════╡
│ hello worldhello worldhello wo… │
└─────────────────────────────────┘

$ ./preloaded.py j.py
Existing socket, connected
Python-preloaded fork-server child main, pid 723418
Open new PTY
Send PTY fd to server
Wait for server to be ready
Entering PTY proxy loop
os.terminal_size(columns=0, lines=0)
shape: (1, 1)
┌─────┐
│ j   │
│ --- │
│ str │
╞═════╡
│ hel │
│ lo  │
│ wor │
│ ldh │
│ ell │
│ o   │
│ wor │
│ ldh │
│ ell │
│ o   │
│ wo… │
└─────┘

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions