DQD.ForkPTY
1.6.0
dotnet add package DQD.ForkPTY --version 1.6.0
NuGet\Install-Package DQD.ForkPTY -Version 1.6.0
<PackageReference Include="DQD.ForkPTY" Version="1.6.0" />
<PackageVersion Include="DQD.ForkPTY" Version="1.6.0" />
<PackageReference Include="DQD.ForkPTY" />
paket add DQD.ForkPTY --version 1.6.0
#r "nuget: DQD.ForkPTY, 1.6.0"
#:package DQD.ForkPTY@1.6.0
#addin nuget:?package=DQD.ForkPTY&version=1.6.0
#tool nuget:?package=DQD.ForkPTY&version=1.6.0
DQD.ForkPTY
DQD.ForkPTY is a .NET library that bundles native binary components under the hood to enable the use of forkpty() across multiple supported platforms. Using forkpty (or fork in general) is not possible from managed code; a wrapper written in a bare metal language is needed.
Usage
public static class Forker
{
public static ForkResult ForkPTYAndExec(PTYConfiguration configuration, string fileName, string?[]? argv = null);
}
public class PTYConfiguration
{
public Size CharacterSize;
public Size PixelSize;
}
public struct Size
{
public int Width;
public int Height;
}
Set up a suitable PTYConfiguration instance and call Forker.ForkPTYAndExec with your designed program filename and (optional) arguments.
- If the platform is not supported, a
PlatformNotSupportedExceptionwill be thrown. - If an error occurs, a
Win32Exceptionwill be thrown with the capturederrnovalue. - If the call succeeds, a
ForkResultwill be returned that contains the child process ID and aStreamwrapping its PTY.ForkResultimplementsIDisposableand disposes the PTY stream when it is disposed.
Example
See the DQD.ForkPTY.Playground project for a simple example of use.
Contributing
Contributions -- issues, pull requests, discussion -- are welcome on the GitHub page.
License
DQD.ForkPTY is provided under the MIT open source license. See LICENSE.md for more details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.