mabe02 / lanterna

Java library for creating text-based GUIs
GNU Lesser General Public License v3.0
2.23k stars 243 forks source link

Terminal window resize and resizing disabling #568

Closed Krzyshio closed 12 months ago

Krzyshio commented 1 year ago

Is there any possibility to resize the terminal from the code layer at runtime?

On the other hand, is it possible to set the terminal as not resizable by the user?

avl42 commented 1 year ago

Assuming you're talking about AWT- or SwingTerminals. Then, if you need control over the Window (in Swing's sense, not Lanterna's), you could create a SwingTerminal and wrap it in a Swing Frame that you then can control by means of Swing: allow/disallow resizing by user, resize it from Java code...

On Thu, Oct 13, 2022 at 10:45 AM Sophusy @.***> wrote:

Is there any possibility to resize the terminal from the code layer at runtime?

On the other hand, is it possible to set the terminal as not resizable by the user?

— Reply to this email directly, view it on GitHub https://github.com/mabe02/lanterna/issues/568, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIDBMR2I5VEX6L7HX7PXO3WC7D2NANCNFSM6AAAAAAREBGE5M . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mabe02 commented 12 months ago

Yeah, I don't think there's any way to resize xterm or other emulators by control codes. That seems both crazy and potentially dangerous. But if you use the Java terminal emulator that comes with Lanterna, you can resize it as @avl42 describes.