Click or drag to resize

LinuxConsoleAllocator Class

The Linux counterpart of the Windows AllocConsole function (which is not available there): opens a terminal emulator window that displays the output of the process. A named pipe (FIFO) is created and the terminal emulator is started with a command that copies the pipe content to its window; then the standard output and standard error file descriptors (1 and 2) of the process are redirected into the pipe, so everything written to the console from then on (also via a freshly opened Console.OpenStandardOutput()) ends up in the window. Output only, the standard input of the process stays as it is.
Inheritance Hierarchy
SystemObject
  de.unika.ipd.grGen.libConsoleAndOSLinuxConsoleAllocator

Namespace:  de.unika.ipd.grGen.libConsoleAndOS
Assembly:  libConsoleAndOS (in libConsoleAndOS.dll) Version: GrGen.NET 8.6
Syntax
C#
public static class LinuxConsoleAllocator

The LinuxConsoleAllocator type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAlloc
Opens a terminal emulator window and redirects stdout and stderr into it. Returns true on success (or if the console was already allocated), false if no console could be allocated (e.g. because there is no display, or no known terminal emulator is installed), the reason is printed to stderr then.
Public methodStatic memberFree
Restores stdout and stderr, which closes the pipe to the terminal emulator window (it then shows a hint and waits for Enter). Returns true if a console was allocated before.
Top
See Also