+
    lh\                         R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHtHt ^ RIHtHtH	t	 . ROt
^ t^t^t^ tR tR tR tR t]]3R	 lt]]3R
 ltR# )zPseudo terminal utilities.)selectN)closewaitpid)setraw	tcgetattr	tcsetattrc                 L    \         P                  ! 4       #   \        \        3 d     Mi ; i\	        4       w  r\         P
                  ! T\         P                  4      p ^ RIHpH	p M  \         d    Y3u # i ; i T! Y$R4       T! Y$R4       Y3#   \         d     Y3# i ; i)z`openpty() -> (master_fd, slave_fd)
Open a pty master/slave pair, using os.openpty() if possible.)ioctlI_PUSHptemldterm)osopenptyAttributeErrorOSError_open_terminalopenO_RDWRfcntlr	   r
   ImportError)	master_fd
slave_nameslave_fdr	   r
   s        lib/python3.14/pty.pyr   r      s    zz|G$ *,Iwwz299-H$'' $#	#$h'h)   s0    ++ A) )A:9A:>B B#"B#c                     R FV  p R FM  pRV ,           V,           p \         P                  ! V\         P                  4      pTRT ,           T,           3u u # 	  KX  	  \        R4      h  \         d     Kn  i ; i)z1Open pty master and return (master_fd, tty_name).pqrstuvwxyzPQRST0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devices)r   r   r   r   )xypty_namefds       r   r   r   0   su    #A!A~)HWWXryy1 
Q*++ $   &
''  s   %A((A76A7c                     \         P                  ! 4       w  rV \        8X  d    \         P                  ! 4        W3# W3#   \         d     Y3# i ; i  \
        \        3 d     Mi ; i\        4       w  r#\         P                  ! 4       p T \        8X  d0   \         P                  ! T4       \         P                  ! T4       Y3# \         P                  ! T4       Y3# )z`fork() -> (pid, master_fd)
Fork and make the child a session leader with a controlling terminal.)
r   forkptyCHILDsetsidr   r   r   forkr   	login_tty)pidr    r   r   s       r   r%   r%   =   s    **, %<		 wsw  w G$  ")I
'')C
e|

X
 > 	 >s"   A A   AAA'&A'c                0    \         P                  ! V R4      # )zDefault read function.i   )r   read)r    s   &r   _readr*   Y   s    772t    c                ,   \         P                  ! V 4      '       d?   \         P                  ! V R4        \        WVR7       \         P                  ! V R4       R# RpV \        8g  pV \
        8g  pRpRp . p. p	V'       d&   \        V4      V8  d   VP                  \        4       V'       d"   \        V4      V8  d   VP                  V 4       V'       d&   \        V4      ^ 8  d   V	P                  \
        4       \        V4      ^ 8  d   V	P                  V 4       \        W. 4      w  rp
\
        V	9   d!    \         P                  ! \
        V4      pW{R pW9   d    V! V 4      pV'       g   R# W|,          pW	9   d   \         P                  ! W4      pWkR pV'       g   EK/  \        V9   g   EK=  V! \        4      pV'       g   RpEKV  Wl,          pEKa    \         P                  ! T R4       i ; i  \         d    Rp Li ; i  \         d    Rp Li ; i)zParent copy loop.
Copies
        pty master -> standard output   (master_read)
        standard input -> pty master    (stdin_read)F)master_read
stdin_readTNi   r+   )r   get_blockingset_blocking_copySTDIN_FILENOSTDOUT_FILENOlenappendr   writer   )r   r-   r.   high_waterlevelstdin_availstdout_availi_bufo_bufrfdswfds_xfdsndatas   &&&          r   r1   r1   ]   s   
 
y!! 		5)	-)L OOIt,O|+K-LEE
3u:7KK%CJ8KK	"CJNKK&u:>KK	""4r2ED %HH]E2b	 "9- ME*A"IE;<4/l+D#c OOIt,2  %$%  s/   G 7G0 H G-0H ?H HHc                H   \        V \        4      '       d   V 3p \        P                  ! RV 4       \	        4       w  r4V\
        8X  d    \        P                  ! V ^ ,          .V O5!    \        \        4      p\        \        4       Rp \        WAV4       V'       d    \        \        \        P                  X4       \!        T4       \#        T^ 4      ^,          #   \        P                   d    Rp Lki ; i  T'       d!   \        \        \        P                  X4       i i ; i)zCreate a spawned process.z	pty.spawnTF)
isinstancestrsysauditr%   r#   r   execlpr   r2   r   ttyerrorr1   r   	TCSAFLUSHr   r   )argvr-   r.   r'   r   moderestores   &&&    r   spawnrM      s    $wIIk4 VNC
e|
		$q'!D!&|9ij1lCMM48	)3?1 99  lCMM48 s   ( C 	C7 C43C47*D!)r   r%   rM   )__doc__r   r   rD   rG   r   r   r   r   r   __all__r2   r3   STDERR_FILENOr#   r   r   r%   r*   r1   rM    r+   r   <module>rR      sg       	 
 
  , ,
&	,
(8 "'5 ?B "e r+   