Skip to content

Support terminal resizing (MacOS, Linux only) #44

@keynmol

Description

@keynmol

We can use signals (SIGWINCH) and two threads to handle resizing.

Here's a simple gist where I tested that it works: https://gist.github.com/keynmol/e5322a01c85edfa521fe5f6aebb2bef6

We will need to run the input provider on a separate thread.

We should add another group of events – Event.TerminalChange(size = WindowSize(width = ..., height = ...)), and add an optional WindowSize parameter to Event.Init, so that the prompt can optionally size itself accordingly to the window size.

This will involve some non-trivial logic in fitting the text on the screen horizontally, potentially splitting it in multiple lines (depends on #43)

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