Terminal-Print icon indicating copy to clipboard operation
Terminal-Print copied to clipboard

Is there no support for SIGWINCH?

Open timo opened this issue 9 years ago • 3 comments

From your blog post and a very brief glimpse at the readme, it doesn't seem like i can resize the grid at run time when i get a SIGWINCH to alert me that the terminal has changed its size ...

timo avatar Sep 05 '16 21:09 timo

Good point!

After a brief test, I can confirm that Perl 6 signal handling supports this with no problem. I will try to patch this soon.

I want to think about reflowing, though. I think this may need to be handled in the consuming application, as I have deliberately kept Terminal::Print "dumb".

My initial thought is to re-calculate width and height, then create a new grid and import changed cells into the new grid. Reflowing would involve some calculations to keep relative ratios more or less sane, but so far Terminal::Print isn't concerned about that level of the display. It just prints what you want, where you wanted it.

ab5tract avatar Sep 06 '16 14:09 ab5tract

Hmmm...

Use a Terminal;:Print::Reflow which would establish a default event that does exactly as you describe, but can allow the user to redefine said event via constructor?

Just a thought. This way you provide a sensible option without the need to write extra code, but also allow the flexibility for the user to adopt their own methods.

Xliff avatar Aug 22 '17 15:08 Xliff

Xliff: This is something I had planned to take a look at as I worked a bit more on the high-level widget support code. That work had been blocked on the RawInput and DecodedInput pieces, which is there now, so (as time permits) I can go back to thinking about higher-level widgets and layout functionality. I have some exploratory code in my local repo, but it feels like throwaway work just to feel out the problem space.

japhb avatar Aug 31 '17 00:08 japhb