winpty.pyi 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # -*- coding: utf-8 -*-
  2. """Stub typing declarations for the native PTY object."""
  3. # Standard library imports
  4. from typing import Optional
  5. # Local imports
  6. from .enums import MouseMode, AgentConfig
  7. __version__: str
  8. class WinptyError(Exception): ...
  9. class PTY:
  10. def __init__(
  11. self,
  12. cols: int,
  13. rows: int,
  14. backend: Optional[int] = None,
  15. mouse_mode: int = MouseMode.WINPTY_MOUSE_MODE_NONE,
  16. timeout: int = 30000,
  17. agent_config: int = AgentConfig.WINPTY_FLAG_COLOR_ESCAPES,
  18. ): ...
  19. def spawn(
  20. self,
  21. appname: str,
  22. cmdline: Optional[str] = None,
  23. cwd: Optional[str] = None,
  24. env: Optional[str] = None,
  25. ) -> bool: ...
  26. def set_size(self, cols: int, rows: int): ...
  27. def read(self, blocking: bool = False) -> str: ...
  28. def write(self, to_write: str) -> int: ...
  29. def isalive(self) -> bool: ...
  30. def get_exitstatus(self) -> Optional[int]: ...
  31. def iseof(self) -> bool: ...
  32. def cancel_io(self) -> bool: ...
  33. @property
  34. def pid(self) -> Optional[int]: ...
  35. @property
  36. def fd(self) -> Optional[int]: ...