mirror of
https://github.com/NCBM/plyngent.git
synced 2026-07-23 05:55:16 +08:00
core/process: cross-platform PTY via backend and pywinpty
POSIX openpty/fork and Windows ConPTY; win32 marker dep plus typings stub.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
"""Stubs for pywinpty (ConPTY) matching winpty.PtyProcess runtime API."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Sequence
|
||||
from typing import Any
|
||||
|
||||
class PtyProcess:
|
||||
exitstatus: int | None
|
||||
|
||||
@classmethod
|
||||
def spawn(
|
||||
cls,
|
||||
argv: str | Sequence[str],
|
||||
cwd: str | None = None,
|
||||
env: dict[str, str] | None = None,
|
||||
dimensions: tuple[int, int] = (24, 80),
|
||||
backend: int | None = None,
|
||||
) -> PtyProcess: ...
|
||||
def isalive(self) -> bool: ...
|
||||
def read(self, size: int = 1024) -> str: ...
|
||||
def write(self, s: str) -> int: ...
|
||||
def terminate(self, force: bool = False) -> bool: ...
|
||||
def kill(self, sig: int | None = None) -> None: ...
|
||||
def close(self, force: bool = False) -> None: ...
|
||||
def wait(self) -> int | None: ...
|
||||
def fileno(self) -> int: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def setwinsize(self, rows: int, cols: int) -> None: ...
|
||||
def getwinsize(self) -> tuple[int, int]: ...
|
||||
Reference in New Issue
Block a user