inducer / pudb

Full-screen console debugger for Python
https://documen.tician.de/pudb/
Other
2.99k stars 229 forks source link

Get terminal size using os.get_terminal_size() #536

Closed h5rdly closed 2 years ago

h5rdly commented 2 years ago

Hi,

A small PR to swap out the usage of fcntl / termios with os.get_terminal_size().

I was hoping to try and help make pudb cross-platform, this looks like a first step :)

Thanks, Eli

inducer commented 2 years ago

Thanks! This looks good to me, other than the linter failure. Could you take a look?

AFAICT, get_terminal_size is available on Py3 unconditionally, given the lack of version numbers here.

inducer commented 2 years ago

Thanks!

h5rdly commented 2 years ago

My bad, removed unused import struct.

get_terminal_size() works on 3.6+, can't vouch for earlier versions :)