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

COLS() and LINES() shouldn't be cached #21

Closed
pprocacci opened this issue Nov 9, 2018 · 1 comment
Closed

COLS() and LINES() shouldn't be cached #21

pprocacci opened this issue Nov 9, 2018 · 1 comment

Comments

@pprocacci
Copy link

pprocacci commented Nov 9, 2018

Programs running a la windows(not the os)/terminals that resize generally deliver a SIGWINCH upon that resize occuring.

COLS() and LINES() should always contain the current window dimensions. Currently they only return the dimensions that they were initially invoked with.

Example:


sub x()
{
  say COLS();
}

initscr();
signal(SIGWINCH).tap: { x() }

loop {
  sleep(1);
}
@pprocacci
Copy link
Author

This is my mistake. I forget a necessary endwin in order to refresh the ncurses state.

endwin;
refresh;

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