Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying terminal size #119

Open
mgunyho opened this issue Apr 1, 2024 · 0 comments
Open

Allow specifying terminal size #119

mgunyho opened this issue Apr 1, 2024 · 0 comments

Comments

@mgunyho
Copy link

mgunyho commented Apr 1, 2024

Hi, this is a follow-up for #17. Basically I would like to be able to set the terminal size for the spawned process.

My use case is as follows: I'm using rexpect to create integration tests for my full-screen TUI app (like vim), where I launch the program, send some keystrokes to it, and check that the printed characters are as expected. The layout of my app will depend on the terminal size, and for example some elements are not drawn at all if the size is zero. Currently I can't test my app properly without setting the terminal size.

Currently, my program actually crashes with a zero-size terminal, which I should probably handle, but I am still unable to test the screen contents.

(As another sidenote, this issue didn't come up before because crossterm (the library I'm using for the TUI) used to check if the size from /dev/tty (set by rexpect) is zero, and if it was, it used tput to query the terminal size instead. However, after an update, this check was removed and it returns a zero-size terminal now, which breaks my tests.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant