You can edit almost every page by Creating an account. Otherwise, see the FAQ.

terminal.Gui

From EverybodyWiki Bios & Wiki




Script error: No such module "Draft topics". Script error: No such module "AfC topic".

Terminal.Gui
Terminal.Gui UI Catalog sample app
Terminal.Gui UI Catalog sample app
Developer(s)Miguel de Icaza
Initial release2007
Stable release
1.8 / September 21, 2022
Written inAny .NET language
Engine
    TypeWidget toolkit
    LicenseMIT License
    Websitegithub.com/gui-cs/Terminal.Gui

    Search Terminal.Gui on Amazon.

    Terminal.Gui is a cross platform programming library for creating TUI Applications using .NET. It works on the Windows, Linux, and Mac platforms.[1] The project is released under the MIT License.

    Overview[edit]

    Terminal.Gui provides a full featured programming API for creating TUI Applications using .NET that run on Windows, Mac , and Linux[2]

    A Terminal.Gui application is an event-driven application supported by Microsoft's .NET Core framework.

    Using Terminal.Gui, programmers are able to write TUI applications without needing to know what operating system or terminal (or console) the application will run on. The Terminal.Gui library includes abstraction layer (via the "ConsoleDriver" base class) that isolates the library and applications written using it from the differences between operating systems and terminals. This abstraction layer currently supports four console drivers:[3]

    Terminal.Gui is a .NET library and applications can be written using any programming language supported by .NET, including C#, F#, and PowerShell. The library itself is written in C#.

    All visual elements in the Terminal.Gui library derive from the View class. The View class provides the minimal functionality of a user interface element such as location, size, color, text, as well as common events for handling keyboard and mouse input. Layout of visual elements can be done using absolute or computed layout. Absolute layout lets developers specify the precise row and column in the terminal where the View should be placed. Computed layout automatically places the Views in the terminal based on constraints the developer specifies using the `Dim` and `Pos` classes. Every view can be a container for an arbitrary number of child views.

    The library includes View-derived classes for many common user interface elements including Button, ColorPicker, DateField, GraphView, HexView, ProgressBar, TableView, TreeView, and TextView. Some View classes act as pop-up/modal windows, such as MessageBox, Dialog, and Wizard.[4]

    Terminal.Gui applications can have a menu bar via the Menu`` class as well as pop-up menus via the ContextMenu class. A StatusBar class enables an application's status to be displayed at the bottom of the screen.

    Terminal.Gui is generally not thread-safe, but supports multi-threading via the Application.MainLoop.Invoke API.

    Because Terminal.Gui is based on .NET Core, building TUI apps with it is easy. Typing the following commands on any system with .NET Core installed will create an empty app:[5]

    dotnet new console
    dotnet add package Terminal.Gui
    

    Good API documentation is provided[6], as well as examples in C# and F#. The UI Catalog sample illustrates almost all aspects of the library and also serves as a tool for testing the library.

    Usage Example[edit]

    Terminal.Gui applications can be written in just a few lines of code.[7] For example:

    Application.Init ();
    var top = Application.Top;
    var label = new Label("Hello, Terminal.Gui!");
    top.Add(label); 
    Application.Run();
    Application.Shutdown();
    

    Examples of TUI Apps Built with Terminal.Gui[edit]

    • Microsoft's PowerShell includes the Out-ConsoleGridView Cmdlet that lets [[PowerShell] users process large amounts of data in a graphical way while remaining in the terminal. Out-ConsoleGridView replaced Out-GridView which was implemented as a traditional GUI application, but was not fully cross-platform.[8][9]
    • PoshRedisViewer - A compact Redis viewer module for PowerShell written in F#.[10]
    • HACC - C# DotNet 6 HTML ANSI Console Canvas.[11]
    • MusicSharp - A TUI Music Player written in C#.[12]

    History[edit]

    Terminal.Gui is derived from gui.cs which Miguel de Icaza wrote in his spare time[13] and released in 2007 as an open-source, cross-platform GUI toolkit written entirely in managed code.[14]

    While Miguel originally called the project gui.cs, the .NET assembly published on Nuget was named Terminal.Gui. To reduce confusion the gui.cs name was deprecated in favor of Terminal.Gui with the 0.90 release on May 20, 2020.[15]

    In 2022, Miguel moved the Terminal.Gui project from his personal Github account to the gui-cs Github organization.[16]

    Screenshots[edit]

    See also[edit]

    References[edit]

    1. "Terminal.Gui - Cross Platform Terminal UI toolkit for .NET". October 16, 2022 – via GitHub.
    2. "Awesome console apps in C#". piraces.dev.
    3. "Cross-Platform Driver Model". gui-cs.github.io.
    4. https://gui-cs.github.io/Terminal.Gui/articles/views.html
    5. "It's 2020 and it is time for text mode with Gui.cs". www.hanselman.com.
    6. Bahraminezhad, Ali (January 15, 2020). "Terminal/Console User Interface in .NET Core". Medium.
    7. Wronski, Sam (February 20, 2020). "Exploring Gui.cs - Custom Terminal UI's in .NET". World of Zero.
    8. Leonhardt, Tyler (March 6, 2020). "A new kind of GridView right in your console: Introducing the early preview of ConsoleGuiTools". PowerShell Team.
    9. "The Powerful PowerShell cmdlet Out-ConsoleGridView". jeroentrimbach.com. April 10, 2022.
    10. "PoshRedisViewer". September 29, 2022 – via GitHub.
    11. "HACC". October 14, 2022 – via GitHub.
    12. McDougall, Mark-James. "Developing a Lightweight TUI Music Player in C# using Terminal.Gui (Part One)". markjames.dev.
    13. "Mono: from Xamarin to WebAssembly, Blazor, and .NET 5 - Q&A with Miguel de Icaza". InfoQ.
    14. "Introducing: gui.cs - Miguel de Icaza". tirania.org.
    15. "updated README · gui-cs/Terminal.Gui@3d984fa". GitHub.
    16. "Terminal.Gui has been moved to to the github.com/gui-cs organization! · Discussion #1744 · gui-cs/Terminal.Gui". GitHub.


    This article "Terminal.Gui" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Terminal.Gui. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.