You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to ensure the box stays decent, I need to react to the terminal window being resized; this means that I need to trap the WINCH signal.
Unfortunately, Reline traps that signal and provides no way for me run my own resize code as well. I expect to be able, in some way, to define my own resize hook that composes with Reline's resize hook.
The text was updated successfully, but these errors were encountered:
Resolvesruby#735
Just as the `handle_interrupted` method runs Reline's interrupt hook logic and then runs any user-defined interrupt hook logic, `handle_resized` should run Reline's resize hook logic and then run any user-defined resize logic.
This allows user CLI's with additional content in addition to the Reline prompt to ensure that additional content is rendered properly as the terminal is resized.
Note: This is my best first attempt at this solution as someone who has only read the source code here today. There may be details/considerations that are important that I missed or didn't consider. I am very open to changes as necessary.
cc: @st0012
Description
I am building a CLI that uses Reline. In this CLI, I render a box at the top of the screen before the readline input:
I want to ensure that this box looks decent in various terminal window sizes. I am trying to avoid something like this:
In order to ensure the box stays decent, I need to react to the terminal window being resized; this means that I need to trap the
WINCH
signal.Unfortunately, Reline traps that signal and provides no way for me run my own resize code as well. I expect to be able, in some way, to define my own resize hook that composes with Reline's resize hook.
The text was updated successfully, but these errors were encountered: