Home

Awesome

Terminal Gui Designer

example workflow NuGet Badge Code Coverage

Cross platform designer for Terminal.Gui applications.

Built with CodeDom and Roslyn, TerminalGuiDesigner lets you create complicated Views with drag and drop just like the WinForms designer you know and love (or hate).

Install the tool from NuGet or follow the Hello World Tutorial:

dotnet tool install --global TerminalGuiDesigner

Update to the latest version using

dotnet tool update --global TerminalGuiDesigner

This project is in alpha. See the feature list for progress.

long-demo

Building


Build using the dotnet 6.0 sdk

cd src
dotnet run

Usage


Install the dotnet sdk and create a new console application with references to Terminal.Gui. Install the TerminalGuiDesigner and create a new dialog:

dotnet new console -n hello
cd hello
dotnet add package Terminal.Gui
dotnet tool install --global TerminalGuiDesigner
TerminalGuiDesigner MyDialog.cs

Enter a namespace then add a Button to the view. Save with Ctrl+S. Exit the designer with Ctrl+Q.

Enter the following into Program.cs

using Terminal.Gui;

Application.Init();

Application.Run(new YourNamespace.MyDialog());

Application.Shutdown();

Run your program with dotnet run

You can add new code to MyDialog.cs but avoid making any changes to MyDialog.Designer.cs as this will be rewritten when saving.

For example in MyDialog.cs after InitializeComponent() add the following:

button1.Clicked += ()=>MessageBox.Query("Hello","Hello World","Ok");

Now when run clicking the button will trigger a message box.

msgbox

You can re-open the designer by running it from the command line with the file you want to edit/create.

TerminalGuiDesigner MyDialog.cs

You can remove the tool using the following:

dotnet tool uninstall --global TerminalGuiDesigner

Troubleshooting

If when running the tool you have issues seeing the colors add the --usc flag:

TerminalGuiDesigner --usc

The designer is built to be robust and has top level catch blocks but if you are still able to crash it you may find your console blocking input. If this happens you should be able to fix your console by typing reset<enter> but also :heart: please report it :heart:

Keybindings & Controls


You can change keybindings by copying Keys.yaml into your current directory.

To edit MenuBar items use the following controls

KeyAction
Shift Up/DownMove selected menu item up/down
Shift RightMove selected menu item to a submenu of the one above
Shift LeftMove selected sub menu item up a level
DelRemove selected menu item
EnterAdd a new menu item
TypingEdit the Title of the selected item
Ctrl + TSet Shortcut
Ctrl + RSet menu field name

New root level menus can be added by right clicking the MenuBar and selecting 'Add Menu'.

You can create a menu separator by typing ---

Features


The following feature list shows the current capabilities and the roadmap. Features in italics are experimental and require passing the -e flag when starting application.

Class Diagram


Terminal.Gui Class Diagram