Title: Implement termios.tcgetwinsize/tcsetwinsize by sigmaith · Pull Request #8347 · RustPython/RustPython · GitHub
Open Graph Title: Implement termios.tcgetwinsize/tcsetwinsize by sigmaith · Pull Request #8347 · RustPython/RustPython
X Title: Implement termios.tcgetwinsize/tcsetwinsize by sigmaith · Pull Request #8347 · RustPython/RustPython
Description: Closes #xxxx This PR follows our AI policy Summary The termios module was missing tcgetwinsize/tcsetwinsize, so calling termios.tcgetwinsize(fd) raised AttributeError. This PR adds both functions, following CPython's implementation Modules/termios.c#L417-L444: crates/host_env/src/termios.rs: low-level ioctl(TIOCGWINSZ/TIOCSWINSZ) wrappers crates/stdlib/src/termios.rs: #[pyfunction]s that expose them to Python, reusing the existing Fildes fd conversion and termios_error helper Lib/test/test_termios.py: removes the expectedFailure markers for test_tcgetwinsize, test_tcgetwinsize_errors, test_tcsetwinsize, test_tcsetwinsize_errors, which now pass Lib/test/test_pty.py: marks test_fork/test_spawn_doesnt_hang as expectedFailure — unmasked by this change, but fail on an unrelated, pre-existing bug (os.login_tty not implemented) Summary by CodeRabbit Summary by CodeRabbit New Features Added termios.tcgetwinsize() to retrieve terminal window dimensions. Added termios.tcsetwinsize() to update terminal window dimensions. Added input validation for the window size argument and clear error reporting when terminal operations fail.
Open Graph Description: Closes #xxxx This PR follows our AI policy Summary The termios module was missing tcgetwinsize/tcsetwinsize, so calling termios.tcgetwinsize(fd) raised AttributeError. This PR adds both function...
X Description: Closes #xxxx This PR follows our AI policy Summary The termios module was missing tcgetwinsize/tcsetwinsize, so calling termios.tcgetwinsize(fd) raised AttributeError. This PR adds both function...
Opengraph URL: https://github.com/RustPython/RustPython/pull/8347
X: @github
Domain: Github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7ab84ed4-019a-0c86-c504-480e4d670adc |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AC84:BCEAA:C17F7A:1082911:6A62C35D |
| html-safe-nonce | 281843a8b9cd1edfdda69194636de8cf08eee8fccc5507c6903cab167de703d6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzg0OkJDRUFBOkMxN0Y3QToxMDgyOTExOjZBNjJDMzVEIiwidmlzaXRvcl9pZCI6IjUwMjI3MTU0MjU1MjY1NjM2NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ac058799fcab1cf8abfa51f0a89032c05736f3e4c5bc5b293712c0d107e16f7e |
| hovercard-subject-tag | pull_request:4108315797 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/8347/files |
| twitter:image | https://avatars.githubusercontent.com/u/125195487?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/125195487?s=400&v=4 |
| og:image:alt | Closes #xxxx This PR follows our AI policy Summary The termios module was missing tcgetwinsize/tcsetwinsize, so calling termios.tcgetwinsize(fd) raised AttributeError. This PR adds both function... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | df33b1b61ee7b9a0af988199bfc3503c9c1acafb1f1d40e1f140ea7c84f890dd |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d41cd1bdb290013455c0ac430fa755621733f5eb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width