Aptivi - Manual
ProjectsWebsiteBlog
Terminaux - Manual
Terminaux - Manual
  • Welcome!
  • Breaking changes
    • API v1.0
    • API v2.0
    • API v3.0
    • API v4.0
    • API v5.0
    • API v6.0
    • API v7.0
  • Usage
    • Preface
    • Console Tools
      • Console Checker
        • Console Size Requirements
      • Image Rendering
        • Icons
      • Console Writers
        • Individual Writers
        • Cyclic Writers
          • Geometric Shapes
          • Charts
          • Text
          • Artistic
          • Progress Bars
          • Lists and Calendars
          • Miscellaneous
        • Informational Boxes
      • Textual UI
        • Interactive TUI
        • Console Screen
        • Console Resize Listener
        • VT Sequences
      • Console Wrapper
      • Console Colors
      • Color Templates
      • Presentation System
      • Console Extensions
      • Nerd Fonts
      • Terminal Info
      • Test Fixtures
      • Terminal Structures
      • Console Logging
    • Input Reader
      • Shells
        • Shell Structure
          • Help System
          • Command Parsing
          • Command Information
          • Command Switches
          • Shell Presets
          • Command Aliasing
      • Other Input
        • Keybindings
        • Choice-based inputs
        • Editors and Viewers
        • Figlet Font Selector
        • Color Wheel
        • Spinner Selector
      • Reader State
      • Reader Settings
      • Syntax Highlighting
      • Pointer Events
    • Color Sequences
      • Color Model Conversions
      • Color Model Parsing
      • Interop with System.Drawing.Color
  • Report an issue
  • Source code
  • API Reference
Powered by GitBook
On this page
Edit on GitHub
  1. Usage
  2. Console Tools
  3. Console Checker

Console Size Requirements

Size requirements for the console can be customized

Last updated 7 months ago

The console size requirement checking has been recently added to the latest version of Terminaux. This assists your application in determining your minimum console size requirements, with the default being the standard console size for historical reasons.

For console applications which require a specific console size, such as Nitrocid KS which requires the above console size, you can call the CheckConsoleSize() function. You can also make it check for sizes other than 80x24, such as 120x30, by passing the width and the height to the same function.

public static bool CheckConsoleSize(int minimumWidth = 80, int minimumHeight = 24)

This function is found in the ConsoleChecker public class so that you can access this function easily.

If you call this function, it first checks to see if there are edge cases regarding running such console application on terminal multiplexers.

  • If you're running your console application on TMUX, it queries the TMUX settings to get how many status lines are there, and subtracts the required height by the number of status lines.

  • If you're running your console application on GNU Screen, it subtracts the minimum height by one, since it doesn't use more than one line to print its status if enabled.

  • If you're running your console application without a terminal multiplexer, it doesn't subtract the minimum height and stays as-is.

Once the terminal multiplexer check is done, it queries the current window width and the window height and compares them to the required width and height. If the requirement is not satisfied, the function returns false. Otherwise, it returns true as the requirements have been satisfied.

The CheckConsoleSizePrompt() function checks to see if the console size requirements have been satisfied. If the requirements aren't satisfied, the application tells you to resize your console window to have a better experience and to press ENTER when resized to the required size.

80x24