diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/python~3.12/library%2Ftty.html | |
new repository
Diffstat (limited to 'devdocs/python~3.12/library%2Ftty.html')
| -rw-r--r-- | devdocs/python~3.12/library%2Ftty.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/devdocs/python~3.12/library%2Ftty.html b/devdocs/python~3.12/library%2Ftty.html new file mode 100644 index 00000000..a000714b --- /dev/null +++ b/devdocs/python~3.12/library%2Ftty.html @@ -0,0 +1,22 @@ + <span id="tty-terminal-control-functions"></span><h1>tty — Terminal control functions</h1> <p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.12/Lib/tty.py">Lib/tty.py</a></p> <p>The <a class="reference internal" href="#module-tty" title="tty: Utility functions that perform common terminal control operations. (Unix)"><code>tty</code></a> module defines functions for putting the tty into cbreak and raw modes.</p> <div class="availability docutils container"> <p><a class="reference internal" href="https://docs.python.org/3.12/library/intro.html#availability"><span class="std std-ref">Availability</span></a>: Unix.</p> </div> <p>Because it requires the <a class="reference internal" href="termios#module-termios" title="termios: POSIX style tty control. (Unix)"><code>termios</code></a> module, it will work only on Unix.</p> <p>The <a class="reference internal" href="#module-tty" title="tty: Utility functions that perform common terminal control operations. (Unix)"><code>tty</code></a> module defines the following functions:</p> <dl class="py function"> <dt class="sig sig-object py" id="tty.cfmakeraw"> +<code>tty.cfmakeraw(mode)</code> </dt> <dd> +<p>Convert the tty attribute list <em>mode</em>, which is a list like the one returned by <a class="reference internal" href="termios#termios.tcgetattr" title="termios.tcgetattr"><code>termios.tcgetattr()</code></a>, to that of a tty in raw mode.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.12.</span></p> </div> </dd> +</dl> <dl class="py function"> <dt class="sig sig-object py" id="tty.cfmakecbreak"> +<code>tty.cfmakecbreak(mode)</code> </dt> <dd> +<p>Convert the tty attribute list <em>mode</em>, which is a list like the one returned by <a class="reference internal" href="termios#termios.tcgetattr" title="termios.tcgetattr"><code>termios.tcgetattr()</code></a>, to that of a tty in cbreak mode.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.12.</span></p> </div> </dd> +</dl> <dl class="py function"> <dt class="sig sig-object py" id="tty.setraw"> +<code>tty.setraw(fd, when=termios.TCSAFLUSH)</code> </dt> <dd> +<p>Change the mode of the file descriptor <em>fd</em> to raw. If <em>when</em> is omitted, it defaults to <a class="reference internal" href="termios#termios.TCSAFLUSH" title="termios.TCSAFLUSH"><code>termios.TCSAFLUSH</code></a>, and is passed to <a class="reference internal" href="termios#termios.tcsetattr" title="termios.tcsetattr"><code>termios.tcsetattr()</code></a>. The return value of <a class="reference internal" href="termios#termios.tcgetattr" title="termios.tcgetattr"><code>termios.tcgetattr()</code></a> is saved before setting <em>fd</em> to raw mode; this value is returned.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.12: </span>The return value is now the original tty attributes, instead of None.</p> </div> </dd> +</dl> <dl class="py function"> <dt class="sig sig-object py" id="tty.setcbreak"> +<code>tty.setcbreak(fd, when=termios.TCSAFLUSH)</code> </dt> <dd> +<p>Change the mode of file descriptor <em>fd</em> to cbreak. If <em>when</em> is omitted, it defaults to <a class="reference internal" href="termios#termios.TCSAFLUSH" title="termios.TCSAFLUSH"><code>termios.TCSAFLUSH</code></a>, and is passed to <a class="reference internal" href="termios#termios.tcsetattr" title="termios.tcsetattr"><code>termios.tcsetattr()</code></a>. The return value of <a class="reference internal" href="termios#termios.tcgetattr" title="termios.tcgetattr"><code>termios.tcgetattr()</code></a> is saved before setting <em>fd</em> to cbreak mode; this value is returned.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.12: </span>The return value is now the original tty attributes, instead of None.</p> </div> </dd> +</dl> <div class="admonition seealso"> <p class="admonition-title">See also</p> <dl class="simple"> <dt> +<code>Module</code> <a class="reference internal" href="termios#module-termios" title="termios: POSIX style tty control. (Unix)"><code>termios</code></a> +</dt> +<dd> +<p>Low-level terminal control interface.</p> </dd> </dl> </div> <div class="_attribution"> + <p class="_attribution-p"> + © 2001–2023 Python Software Foundation<br>Licensed under the PSF License.<br> + <a href="https://docs.python.org/3.12/library/tty.html" class="_attribution-link">https://docs.python.org/3.12/library/tty.html</a> + </p> +</div> |
