Format: application/x-python-code
⬇ Download File (3.3 KB)
   1  o
   2  
   3  ��h;
   4  �@sdZddlZddlZddlZddlmZdaejdkr dd�Z	nej
   5  dkr*d	d�Z	nd
   6  d�Z	dd�Zd
   7  d�Zdd�Z
   8  dadd�Zdd�ZejdkrZej�dd�Ze�d�rYeZeZ
   9  nej
  10  dkrqddlZejjjZejge_dd�Zdd�Zdd�Zdd�Zd$d"d#�ZdS)%z�
  11  Utilities for working with terminals.
  12  
  13  Authors:
  14  
  15  * Brian E. Granger
  16  * Fernando Perez
  17  * Alexander Belchenko (e-mail: bialix AT ukr.net)
  18  �N)�get_terminal_sizeT�posixcC�t�d�dS)N�clear��os�system�r	r	�Lc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/utils/terminal.py�_term_clear�r�win32cCr)N�clsrr	r	r	r
  19  rrcC�dS�Nr	r	r	r	r
  20  r �cCs
  21  |adS)a�Control whether set_term_title is active or not.
  22  
  23      set_term_title() allows writing to the console titlebar.  In embedded
  24      widgets this can cause problems, so this call can be used to toggle it on
  25      or off as needed.
  26  
  27      The default state of the module is for the function to be disabled.
  28  
  29      Parameters
  30      ----------
  31      val : bool
  32          If True, set_term_title() actually writes to the terminal (using the
  33          appropriate platform-specific module).  If False, it is a no-op.
  34      N)�ignore_termtitle)�valr	r	r
  35  �toggle_set_term_title%s
  36  rcOsdS)zDummy no-op.Nr	)�args�kwr	r	r
  37  �_set_term_title8srcCrrr	r	r	r	r
  38  �_restore_term_title=rrFcCs(ts
  39  tj�d�datj�d|�dS)z3 Change virtual terminal title in xterm-workalikes zTz]0;%sN)�_xterm_term_title_saved�sys�stdout�write��titler	r	r
  40  �_set_term_title_xtermDsrcCs*tstjddd�dStj�d�dadS)NzYExpecting xterm_term_title_saved to be True, but is not; will not restore terminal title.�)�
  41  stacklevelzF)r�warnings�warnrrrr	r	r	r
  42  �_restore_term_title_xtermPs�r$�TERM�ZxtermcCst|�dS)z9Set terminal title using ctypes to access the Win32 APIs.N)�SetConsoleTitleWrr	r	r
  43  riscCstrdSt|�dS)z@Set terminal title using the necessary platform-dependent calls.N)rrrr	r	r
  44  �set_term_titlensr(cCstrdSt�dS)z:Restore, if possible, terminal title to the original stateN)rrr	r	r	r
  45  �restore_term_titleus
  46  r)cCst�d�dadS)Nz8This function is deprecated, use toggle_set_term_title()T)r"r#rr	r	r	r
  47  �freeze_term_title|s
  48  r*�P�cCst||f�Sr)�_get_terminal_size)ZdefaultxZdefaultyr	r	r
  49  r�sr)r+r,)�__doc__rrr"�shutilrr-r�namer�platformrrrrrr$�environ�getr%�
  50  startswith�ctypes�windll�kernel32r'�	c_wchar_p�argtypesr(r)r*r	r	r	r
  51  �<module>s@
  52  
  53  
  54  
  55  
  56  
  57  
  58  �
  59  
  60  
  61