import tornado.websocket
from _typeshed import Incomplete
from ptyprocess import PtyProcessUnicode

logger: Incomplete
TERM_TYPE: str

def preexec_fn() -> None: ...

class PtySession:
    pty_id: Incomplete
    websocket: tornado.websocket.WebSocketHandler | None
    pty_proc: PtyProcessUnicode | None
    opened: bool
    closed: bool
    def __init__(self, pty_id: str) -> None: ...
    def open(self, websocket: tornado.websocket.WebSocketHandler, argv, cwd=None, env=None, dimensions=(24, 80)): ...
    def close(self) -> None: ...
    def resize(self, rows: int, cols: int): ...

class PtySessionManager:
    def __init__(self) -> None: ...
    def create_pty(self, argv: list[str], rows: int = 24, cols: int = 80, *, cwd=None, include_system_env_vars: bool = True, custom_env_vars=None) -> str: ...
    def open_pty(self, pty_id: str, websocket: tornado.websocket.WebSocketHandler) -> PtySession: ...
    def session(self, pty_id: str) -> PtySession | None: ...
    def sessions(self) -> dict[str, PtySession]: ...
