
    ^h                        S r SSKrSSKrSSKrSSKJr  Sq\R                  S:X  a  S r	O\R                  S:X  a  S r	OS	 r	S
 rS rS rSqS rS r\R                  S:X  a7  \R"                  R%                  SS5      r\R)                  S5      (       a  \r\rOI\R                  S:X  a9  SSKr\R,                  R.                  R0                  r\R2                  /\l        S rS rS rS rSS jrg)z
Utilities for working with terminals.

Authors:

* Brian E. Granger
* Fernando Perez
* Alexander Belchenko (e-mail: bialix AT ukr.net)
    N)get_terminal_sizeTposixc                  0    [         R                  " S5        g )Nclearossystem     P/home/james-whalen/.local/lib/python3.13/site-packages/IPython/utils/terminal.py_term_clearr      s    
		'r   win32c                  0    [         R                  " S5        g )Nclsr   r
   r   r   r   r      s    
		%r   c                      g Nr
   r
   r   r   r   r       s    r   c                     U (       + q g)a  Control whether set_term_title is active or not.

set_term_title() allows writing to the console titlebar.  In embedded
widgets this can cause problems, so this call can be used to toggle it on
or off as needed.

The default state of the module is for the function to be disabled.

Parameters
----------
val : bool
    If True, set_term_title() actually writes to the terminal (using the
    appropriate platform-specific module).  If False, it is a no-op.
N)ignore_termtitle)vals    r   toggle_set_term_titler   %   s      xr   c                      g)zDummy no-op.Nr
   )argskws     r   _set_term_titler   8   s    r   c                      g r   r
   r
   r   r   _restore_term_titler   =   s    r   Fc                     [         (       d!  [        R                  R                  S5        Sq [        R                  R                  SU -  5        g)z2Change virtual terminal title in xterm-workalikes z[22;0tTz]0;%sN_xterm_term_title_savedsysstdoutwritetitles    r   _set_term_title_xtermr%   D   s9    
 #"

&"&JJ_u,-r   c                  `    [         (       d   e[        R                  R                  S5        Sq g )Nz[23;0tFr   r
   r   r   _restore_term_title_xtermr'   P   s(     #"""JJ\"#r   TERM xtermc                     [        U 5        g)z9Set terminal title using ctypes to access the Win32 APIs.N)SetConsoleTitleWr#   s    r   r   r   c   s
    r   c                 2    [         (       a  g[        U 5        g)z@Set terminal title using the necessary platform-dependent calls.N)r   r   r#   s    r   set_term_titler.   h   s    Er   c                  0    [         (       a  g[        5         g)z:Restore, if possible, terminal title to the original stateN)r   r   r
   r   r   restore_term_titler0   o   s    r   c                  4    [         R                  " S5        Sqg )Nz8This function is deprecated, use toggle_set_term_title()T)warningswarnr   r
   r   r   freeze_term_titler4   v   s    MMLMr   c                     [        X45      $ r   )_get_terminal_size)defaultxdefaultys     r   r   r   |   s    x233r   )P      )__doc__r   r    r2   shutilr   r6   r   namer   platformr   r   r   r   r%   r'   environgetr(   
startswithctypeswindllkernel32r,   	c_wchar_pargtypesr.   r0   r4   r
   r   r   <module>rG      s    
 
  :   77g\\W
 &	
	   	.$ 77g::>>&$Dw/7\\W}}-->>!'!1!1 2 
4r   