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

Probe terminal size for every line #36

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Probe terminal size for every line #36

merged 2 commits into from
Dec 12, 2024

Conversation

eivindbergem
Copy link
Contributor

@eivindbergem eivindbergem commented Dec 4, 2024

Noline initializes the terminal once, probing the size of the terminal. In #35 a new feature was proposed to be able to re-initialize the terminal. The initializer is a bit strict, and will cause an error if the input from the terminal is not exactly as expected, as seen in #12.

This PR solves both these problems by:

  • Removing initializer, and probing terminal size for every line.
  • In case of unexpected input during probing, set terminal size to 24x80, and continue normal operation.

- Remove initializer
- Probe for size every line
- Ignore invalid input during reset
- In case probe fails, assume 24 * 80 size
- Removed separate enums for each number of steps
- Use single array with position
- Implement IntoIterator on Output instead of Iterator
@eivindbergem eivindbergem merged commit 08effd5 into master Dec 12, 2024
6 checks passed
@eivindbergem eivindbergem deleted the dynamic-resizing branch December 12, 2024 14:14
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

Successfully merging this pull request may close these issues.

1 participant