[Mono-dev] System.Console problem

M. David Peterson xmlhacker at gmail.com
Tue Jul 8 00:22:37 EDT 2008

2008/7/7 Johannes Drachenfels <johannes at drachenfels.de>:
> I want to write a command line interface for a linux system which should be
> used over ssh instead of a shell…
How are you defining the difference between the command line and a shell?
Is your end goal simply to provide a way to invoke commands on a remote
machine securely regardless of the terminal/shell application being used, or
do you want to build your own terminal/shell that is specific to your

>  Everything works fine – only the resize of the terminal does not!
Which terminal are you referring to?  They come in all shapes and sizes on
Unix*, and, as far as I know, there isn't any single API in which they have
all have standardized on to control things like the width and height of the
window and buffer.  So while this is only a guess, my assumption would be
that in the Windows world where -- up until a couple of years ago when
Monad, now PowerShell, came into being -- there was really only one terminal
application in cmd.exe, it was easy to map the .NET System.Console API to a
specific application, whereas in the Unix* there is no real way to know
ahead of time which terminal/shell will exist.  In this regard (and assuming
that I'm not way off base as to what seems to be the most logical reason) I
really don't think it's possible to expect any the GUI portions of
System.Console to work in the same way they work on Windows.

Of course you could always hack on the Mono source directly, binding calls
to the System.Console GUI API to the related commands of a given
terminal/shell application via p/invoke (or via writing a C-based bindings
wrapper), but that would require you distribute not only your application,
but the modified System.dll file as well.  You could instead write your own
System.Console-like API, but that wouldn't be very portable unless you also
wrote bindings for cmd.exe.  In this regard, it might be easier to simply
create your own Windows.Forms-based terminal application of which you would
then have full control over the entire look, feel, and functionality on both
Windows and Unix variants.


M. David Peterson
Co-Founder & Chief Architect, 3rd & Urban, LLC
Email: m.david at 3rdandUrban.com | m.david at amp.fm
Mobile: (206) 999-0588
http://3rdandUrban.com | http://amp.fm |
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080707/1197e3d1/attachment-0001.html 

More information about the Mono-devel-list mailing list