
A GUI framework for C# console applications - otherdave
https://github.com/TomaszRewak/C-sharp-console-gui-framework
======
rumanator
The correct term for this sort of "GUI framework" is text-based user interface
(TUI)

[https://en.wikipedia.org/wiki/Text-
based_user_interface](https://en.wikipedia.org/wiki/Text-based_user_interface)

------
mikequinlan
Here is a version written by Miguel de Icaza. I don't know if it is
maintained.

[https://github.com/migueldeicaza/gui.cs](https://github.com/migueldeicaza/gui.cs)

~~~
bjg
He merged commits 3 days, ago... that would lead one to believe it's
maintained.

------
tyingq
The chess game screenshot sort of reminded me of the StarTrek game DEC used to
leave running in their showrooms in the 70's and 80's:
[https://commons.wikimedia.org/wiki/File:Star_Trek_text_game....](https://commons.wikimedia.org/wiki/File:Star_Trek_text_game.png)

I remember being kicked out by salesmen many times while sitting there
playing. They seemed very annoyed that no adults "got it", but many kids did.

~~~
TeMPOraL
> _They seemed very annoyed that no adults "got it", but many kids did._

They were all lobeless creatures who couldn't spot an _opportunity_ even if it
hit them in the face. A true Ferengi would know how to handle this.

~~~
tyingq
To their credit, they did donate a lot of VAX equipment to New Hampshire
public schools where I grew up. They did seem to get the long game there. It
certainly worked on me. DEC's bigger misses came later.

------
gwbas1c
Just curious: Why would someone do a TUI (text-based user interface) on a
modern computer?

Using C# implies that you're running on a device powerful enough for a
traditional GUI.

(And you really don't need much to run C#, just enough RAM / Disk for the
framework and to handle the overhead of the garbage collector.)

~~~
kbenson
Very common for server software, where you may not have a GUI environment
installed.

You can run SSH as a server on windows boxes easily now, and depending on your
needs (or to standardize across a heterogeneous fleet of servers) it might
make sense to have some good CLI/TUI utilities available that are cross-
platform.

While I imagine most people won't jump to a TUI for Windows, it could also be
a secondary interface for an application that's run on both Windows and
Linux/BSD. If no GUI (or no Windows GUI) is detected, approximate the same
display using a TUI. The guys of the application can be the same, and you
don't have to ship two versions (assuming the rest of the internals area
already portable).

~~~
gwbas1c
(Joke)

Then maybe a cool project is an adapter to allow the text-based GUI to work
natively when running in a GUI!

------
MrGilbert
What I like about this in contrast to Miguel's TUI is how easy it is to change
the colors for the interface.

I wish it would have mouse support, though - not sure how much effort it would
be to add it to it. Mouse support is something I really like about GUI.cs

------
ChrisRR
Now if only we could get cross platform WPF for C#

~~~
Someone1234
I've used WPF, and I have no specific issue with it (and believe it was an
upgrade over Forms). But even as someone very familiar with C#/WPF, and a fan
of C#/.Net Core I cannot see why you'd want to port WPF when a platform like
Electron exists and already works extremely well as a cross-platform
framework.

It isn't simply the functionality, but also the massive
community/examples/tutorials/etc that already exist for the
JavaScript/Node/Electron ecosystem. WPF, even on Windows, is much smaller but
if they ever ported it to Linux/MacOS/iOS/iPadOS/Android the resources would
be microscopic, and it would be a legitimate limiter to the platform's
success.

It would largely be dead on arrival. I wouldn't even use it (and I am their
core developer demographic). The only argument people can make is performance,
and WPF isn't exactly speedy itself (particularly without hardware
acceleration). Plus you're competing with a much better ingrained Qt.

I was actually trying to create a cross-platform solution this weekend between
PyQt and Electron, and ultimately wound up using Electron, not because it is
better within itself but because you have this huge ecosystem of
samples/snippets/etc to built upon. It is a productivity multiplier.

~~~
naikrovek
There are many reasons why one would not want to use Electron to write an
application.

\- An Electron application is necessarily slower and larger than a native
application with the same functionality

\- An Electron application is yet another browser instance on a user's
machine, with all the vulnerabilities of that version of Chrome

Those two _alone_ are enough reasons for a lot of (but still far too few)
developers.

Software is getting slower much more rapidly than hardware is getting faster,
and one of the reasons for that is Electron and how seductive it is to
application developers.

------
voltagex_
I wonder how hard it would be to port proper ncurses now that Windows 10 has
reasonably complete VT100+ support.

------
hprotagonist
a GUI for CLIs is called a TUI.

~~~
seanmcdirmid
Tangible user interfaces? Ah according to wiki it now also means text-user
interface.

~~~
usepgp
Terminal User Interface or Text-based User Interface

------
xmichael999
Very cool, can't wait to try it out! I've been using Miguel de Icaza's Console
project with success but I feel this project might have a ton more options and
flexibility!

------
moron4hire
This is very interesting. Really glad to see this implemented as a .NET
Standard 2.0 package. I've had a huge problem with making UIs for various
systems. Something like this could be a good starting point for building a
cross-platform, minimally viable GUI for those systems. I don't need native-
looking GUI, I just need functional and not completely broken like Unity's GUI
system is/are.

------
ComputerGuru
This implements the WPF-esque grid model, as mentioned. Does anyone know of a
performant grid-based ncurses library?

------
m0xte
Wow we’ve gone full circle. This is reminiscent of Visual Basic for MSDOS
which was quite frankly excellent.

~~~
tonyedgecombe
Which was preceded by Borland's Turbo Vision:
[https://en.wikipedia.org/wiki/Turbo_Vision](https://en.wikipedia.org/wiki/Turbo_Vision)

------
pantulis
This reminds me of the sheer joy of Borland's Turbo Vision circa 1991.

~~~
int_19h
Turbo Vision is still kinda sorta alive as FreeVision, shipped as part of
FreePascal, and driving their TUI IDE that's visually a clone of Borland
Pascal for DOS:

[https://i.imgur.com/Zj2KOG1.jpg](https://i.imgur.com/Zj2KOG1.jpg)

------
Yuioup
I was just thinking yesterday that it would be cool if there was something
like this for VSCode, just like for the well known text editors, so I can
launch it in an ssh session.

~~~
heartbreak
VS Code has _really_ good support for editing over SSH built into a preview
extension now [0]. It is as seamless as running vim over ssh, except it’s a
GUI app running locally connected to a temporary VS Code server on the remote.
It even supports extensions installed on the remote. I’ve tried so many
different implementations to get Sublime working in this config (like SSH
forwarding a samba share) and they’re all terrible compared to VS Code’s.

[0] [https://code.visualstudio.com/docs/remote/remote-
overview](https://code.visualstudio.com/docs/remote/remote-overview)

------
gitgud
What would this be used for?

~~~
krautsourced
I use these kind of text based ui's for internal tools where dealing with a
full graphical UI is often 50% or more of the actual work. It's easier for the
novice user to use tools with basic text based user interface than to use
command lines, but it's much faster to develop than a WPF app (and it's multi
platform)

------
kovek
I wish we could do this easily with emacs

~~~
hprotagonist
hydras are more or less this.

~~~
kovek
I think that this project is about displaying information graphically in a
textual interface. I think with emacs you can do so but it's difficult. I
think hydras are not this. Hydras are more or less for grouping commands
together.

------
sqldba
I wonder why the vertical lines have breaks in them. It didn’t used to be like
that in the old days.

~~~
BonesJustice
Just an annoyance in the Consolas font metrics. It would look correct in the
bitmapped old console font.

------
investologia
Reminds me of UNIX curses

------
iso-8859-1
So is this cross-platform? How does it compare to
[http://hackage.haskell.org/package/brick](http://hackage.haskell.org/package/brick)
?

~~~
tonyedgecombe
It's .Net Core but there doesn't seem to be any mention of running it on Linux
or macOS.

~~~
moron4hire
The example is .NET Core 2.1, but the actual library itself is .NET Standard
2.0.

It will depend on how the System.Console class is implemented in Linux and
macOS. It might fair better to port the example to Mono or .NET Core 3.0
(which should just be a change of build settings).

    
    
      _______________
      |   |     |   |
      |   | STD |   |
      |   |_____|   |
      |      |      |
      |  FX  | CORE |
      |______|______|

