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

Implement interactive mode #29

Merged
merged 2 commits into from
Oct 19, 2022
Merged

Implement interactive mode #29

merged 2 commits into from
Oct 19, 2022

Conversation

Bodigrim
Copy link
Contributor

Closes #28.

Because getTerminalSize from ansi-terminal expects not only stdout,
but also stdin to be a terminal, which is too restrictive.
@chshersh chshersh added the hacktoberfest-accepted https://hacktoberfest.com/participation/ label Oct 18, 2022
Copy link
Owner

@chshersh chshersh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this looks pretty good! 👏🏻

I have only one minor refactoring suggestion but otherwise, I'm glad that multiple parts of the code could be reused 🙂

Comment on lines 5 to 6
Copyright : (c) 2019 Alexander Gugel
(c) 2022 Dmitrii Kovanikov
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no complaints on the current copyright, you can even put your name here if you want 🙂

But I'm curious about the original code 🤔 Where a similar code was already written?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I just copied header from DrCabal.Watch.

Comment on lines 70 to 74
-- https://github.com/UnkindPartition/ansi-terminal/issues/141
when (chartHeight > 0) $
cursorUp chartHeight
setCursorColumn 0
clearFromCursorToScreenEnd
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this into a separate function clearScreen or something like that for readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@chshersh chshersh added the enhancement New feature or request label Oct 18, 2022
Copy link
Owner

@chshersh chshersh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👏🏻
That's really great!

@chshersh chshersh merged commit e8d6324 into chshersh:main Oct 19, 2022
@chshersh chshersh mentioned this pull request Oct 23, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest-accepted https://hacktoberfest.com/participation/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interactive mode
2 participants