Skip to content

Allow specifying terminal size #119

@mgunyho

Description

@mgunyho

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions