CINXE.COM

IO::Pty - Pseudo TTY object class - metacpan.org

<!DOCTYPE html> <html lang="en-US"> <head> <title>IO::Pty - Pseudo TTY object class - metacpan.org</title> <link rel="preload" as="fetch" href="/account/login_status" crossorigin="anonymous" /> <link href="/assets/style-XFEQ536G.css" rel="stylesheet" type="text/css"> <script src="/assets/main-WXBSEDQJ.js" type="module"></script> <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of IO-Tty - MetaCPAN" href="/dist/IO-Tty/releases.rss" /> <link rel="canonical" href="https://metacpan.org/pod/IO::Pty" /> <meta name="description" content="Pseudo TTY object class" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5"> <link rel="shortcut icon" href="/static/icons/favicon.ico"> <link rel="apple-touch-icon" sizes="152x152" href="/static/icons/apple-touch-icon.png"> <link rel="search" href="/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN"> <script async src="https://perl-ads.perlhacks.com/perl-ads.js"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-E82Q2V8LVD"></script> <meta property="og:site_name" content="MetaCPAN" /> <meta name="twitter:site" content="@metacpan" /> <meta property="og:type" content="article" /> <meta name="twitter:card" content="summary" /> <meta property="og:url" content="https://metacpan.org/pod/IO::Pty" /> <meta property="og:title" content="IO::Pty" /> <meta property="og:description" content="Pseudo TTY object class" /> <meta property="og:image" content="https://metacpan.org/static/images/dots.png" /> </head> <body> <nav class="navbar navbar-default" role="navigation"> <div class="header-logo-large hidden-xs"> <a href="/" tabindex="0"> <svg class="logo" aria-label="MetaCPAN"> <use class="logo" href="/static/images/metacpan-logo.svg#logo" /> </svg> </a> </div> <div class="header-logo-icon visible-xs"> <a href="/"> <svg class="logo" aria-label="MetaCPAN"> <use class="logo" href="/static/images/metacpan-logo.svg#dots" /> </svg> </a> </div> <ul class="nav navbar-nav menu-items hidden-xs hidden-sm"> <li><a href="/about">About</a></li> <li><a href="/about/sponsors">Sponsor</a></li> <li><a href="https://grep.metacpan.org/">grep::cpan</a></li> <li><a href="/recent">Recent</a></li> <li><a href="/about/faq">FAQ</a></li> <li><a href="/tools">Tools</a></li> <li><a href="https://fastapi.metacpan.org/">API</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <button type="button" class="searchbar-btn visible-xs visible-sm"> <i class="fa fa-search button-fa-icon"></i> </button> <form action="/search" class="searchbar-form visible-md visible-lg search-form form-horizontal"> <input type="hidden" name="size" id="metacpan_search-size" value="20"> <div class="form-group"> <div class="search-group"> <i class="fa fa-search"></i> <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value=""> </div> </div> </form> <li class="icon-slidepanel visible-xs visible-sm"> <button data-toggle="slidepanel" data-target=".slidepanel"> <span class="button-fa-icon"> <i class="fa fa-bars slidepanel-open"></i> <i class="fa fa-times slidepanel-close"></i> </span> </button> </li> <li class="dropdown login-dropdown show-logged-in"> <button type="button" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i> <i class="fas fa-chevron-down"></i> </button> <ul class="dropdown-menu"> <li><a href="/account/identities">Identities</a></li> <li><a href="/account/profile">Profile</a></li> <li><a href="/account/favorite/list">Favorites</a></li> <li> <a href="#" type="button" class="logout-button"> Logout </a> </li> </ul> </li> <li class="dropdown login-dropdown show-logged-out"> <button type="button" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-user button-fa-icon avatar-placeholder" aria-hidden="true"></i> <i class="fas fa-chevron-down"></i> </button> <ul class="dropdown-menu"> <li> <a href="/login/github"> <i class="fab fa-github fa-fw"></i> GitHub </a> </li> <li> <a href="/login/twitter"> <i class="fab fa-twitter fa-fw"></i> Twitter </a> </li> <li> <a href="/login/google"> <i class="fab fa-google fa-fw"></i> Google </a> </li> </ul> </li> <li class="dropdown login-dropdown hide-logged-in hide-logged-out"> <button> <i class="fa fa-user button-fa-icon" aria-hidden="true"></i> </button> </li> </ul> </nav> <div class="page-content "> <div id="perl-ad-target" class="top-notify-banner perl-ad-target"> </div> <nav class="sidebar"> <div class="slidepanel"> <ul class="nav-list "> <li class="nav-header no-margin-top"> <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of IO-Tty was released."> <span class="relatize">28 Dec 2023 17:58:49 UTC</span> </div> </li> <li> Distribution: <a href="/dist/IO-Tty">IO-Tty</a> </li> <li> Module version: 1.20 </li> <li> <a data-keyboard-shortcut="g s" href="/dist/IO-Tty/source/Pty.pm">Source</a> (<a href="/dist/IO-Tty/source/Pty.pm?raw=1">raw</a>) </li> <li> <a data-keyboard-shortcut="g b" href="/dist/IO-Tty/source">Browse</a> (<a href="/dist/IO-Tty/source?raw=1">raw</a>) </li> <li> <a data-keyboard-shortcut="g c" href="/dist/IO-Tty/changes">Changes</a> </li> <li> <a class="nopopup" href="/dist/IO-Tty/contribute">How to Contribute</a> </li> <li> <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/toddr/IO-Tty">Repository</a> </li> <li> <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://github.com/toddr/IO-Tty/issues">Issues</a> (4) </li> <li> <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=IO-Tty+1.20" title="Matrix">Testers</a> <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/I/IO-Tty.html?oncpan=1&amp;distmat=1&amp;version=1.20&amp;grade=2" style="color: #090">2586</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/I/IO-Tty.html?oncpan=1&amp;distmat=1&amp;version=1.20&amp;grade=3" style="color: #900">3</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/I/IO-Tty.html?oncpan=1&amp;distmat=1&amp;version=1.20&amp;grade=4">31</a>)</span> </li> <li> <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/TODDR/IO-Tty-1.20">Kwalitee</a> </li> <li> <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on IO-Tty who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)"> Bus factor: 2 </div> </li> <li> License: perl_5 </li> <li class="nav-header">Activity</li> <li> <div class="activity-graph"> <img src="/dist/IO-Tty/activity.svg?res=month" /> <div class="comment">24 month</div> </div> </li> <li class="nav-header">Tools</li> <li> <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/T/TO/TODDR/IO-Tty-1.20.tar.gz"> Download (<span itemprop="fileSize">27.06KB</span>)</a> </li> <li> <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FTODDR%2FIO-Tty-1.20%2FPty.pm"> MetaCPAN Explorer </a> </li> <li> <a href="/dist/IO-Tty/permissions"> Permissions </a> </li> <li> <a href="/dist/IO-Tty/releases.rss"> Subscribe to distribution </a> </li> <li> <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog"> Install Instructions </button> </li> <li> <form action="/search"> <input type="hidden" name="q" value="dist:IO-Tty"> <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form"> <input type="submit" style="display: none"> </form> </li> <li> <form action="https://grep.metacpan.org/search"> <input type="hidden" name="qd" value="IO-Tty"> <input type="hidden" name="source" value="metacpan"> <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form"> <input type="submit" style="display: none"> </form> </li> <li class="version-jump"> <select class="select-navigator form-control tool-bar-form"> <option disabled selected>Jump to version</option> <option disabled value="/release/TODDR/IO-Tty-1.20/view/Pty.pm" >1.20 (TODDR on 2023-12-28)</option> <option value="/release/TODDR/IO-Tty-1.19/view/Pty.pm" >1.19 (TODDR on 2023-12-28)</option> <option value="/release/TODDR/IO-Tty-1.17/view/Pty.pm" >1.17 (TODDR on 2022-11-11)</option> <option value="/release/TODDR/IO-Tty-1.16/view/Pty.pm" >1.16 (TODDR on 2021-01-22)</option> <option value="/release/TODDR/IO-Tty-1.15/view/Pty.pm" >1.15 (TODDR on 2020-11-03)</option> <option value="/release/TODDR/IO-Tty-1.14/view/Pty.pm" >1.14 (TODDR on 2020-01-19)</option> <option value="/release/TODDR/IO-Tty-1.13_01/view/Pty.pm" >1.13_01 DEV (TODDR on 2015-07-27)</option> <option value="/release/TODDR/IO-Tty-1.12/view/Pty.pm" >1.12 (TODDR on 2014-09-12)</option> <option value="/release/TODDR/IO-Tty-1.11/view/Pty.pm" >1.11 (TODDR on 2014-05-05)</option> <option value="/release/RGIERSIG/IO-Tty-1.08/view/Pty.pm" >1.08 (RGIERSIG on 2009-02-24)</option> <option value="/release/RGIERSIG/IO-Tty-1.07/view/Pty.pm" >1.07 (RGIERSIG on 2006-07-18)</option> <option value="/release/RGIERSIG/IO-Tty-1.06/view/Pty.pm" >1.06 (RGIERSIG on 2006-07-17)</option> <option value="/release/RGIERSIG/IO-Tty-1.05/view/Pty.pm" >1.05 (RGIERSIG on 2006-06-09)</option> <option value="/release/RGIERSIG/IO-Tty-1.04/view/Pty.pm" >1.04 (RGIERSIG on 2006-05-31)</option> <option value="/release/RGIERSIG/IO-Tty-1.03/view/Pty.pm" >1.03 (RGIERSIG on 2006-05-05)</option> <option value="/release/RGIERSIG/IO-Tty-1.02/view/Pty.pm" >1.02 (RGIERSIG on 2002-04-02)</option> <option value="/release/GBARR/IO-Tty-0.04/view/Pty.pm" >0.04 (GBARR on 2000-09-04)</option> <optgroup label="BackPAN">' <option value="/release/TODDR/IO-Tty-1.18/view/Pty.pm" >1.18 (TODDR on 2023-11-28)</option> <option value="/release/TODDR/IO-Tty-1.11_01/view/Pty.pm" >1.11_01 DEV (TODDR on 2014-05-05)</option> <option value="/release/TODDR/IO-Tty-1.10/view/Pty.pm" >1.10 (TODDR on 2010-10-11)</option> <option value="/release/TODDR/IO-Tty-1.09_01/view/Pty.pm" >1.09_01 DEV (TODDR on 2010-10-05)</option> <option value="/release/TODDR/IO-Tty-1.09/view/Pty.pm" >1.09 (TODDR on 2010-10-04)</option> <option value="/release/TODDR/IO-Tty-1.08_03/view/Pty.pm" >1.08_03 DEV (TODDR on 2010-10-03)</option> <option value="/release/TODDR/IO-Tty-1.08_02/view/Pty.pm" >1.08_02 DEV (TODDR on 2010-09-10)</option> <option value="/release/TODDR/IO-Tty-1.08_01/view/Pty.pm" >1.08_01 DEV (TODDR on 2010-09-10)</option> <option value="/release/RGIERSIG/IO-Tty-1.01/view/Pty.pm" >1.01 (RGIERSIG on 2002-03-19)</option> <option value="/release/RGIERSIG/IO-Tty-1.00/view/Pty.pm" >1.00 (RGIERSIG on 2002-03-13)</option> <option value="/release/RGIERSIG/IO-Tty-0.97_01/view/Pty.pm" >0.97_01 DEV (RGIERSIG on 2002-02-28)</option> <option value="/release/RGIERSIG/IO-Tty-0.95_01/view/Pty.pm" >0.95_01 DEV (RGIERSIG on 2002-01-31)</option> <option value="/release/RGIERSIG/IO-Tty-0.94_05/view/Pty.pm" >0.94_05 DEV (RGIERSIG on 2002-01-31)</option> <option value="/release/RGIERSIG/IO-Tty-0.94_03/view/Pty.pm" >0.94_03 DEV (RGIERSIG on 2002-01-23)</option> <option value="/release/RGIERSIG/IO-Tty-0.94_02/view/Pty.pm" >0.94_02 DEV (RGIERSIG on 2002-01-18)</option> <option value="/release/RGIERSIG/IO-Tty-0.94_01/view/Pty.pm" >0.94_01 DEV (RGIERSIG on 2002-01-18)</option> <option value="/release/RGIERSIG/IO-Tty-0.92_04/view/Pty.pm" >0.92_04 DEV (RGIERSIG on 2001-11-28)</option> <option value="/release/RGIERSIG/IO-Tty-0.92_03/view/Pty.pm" >0.92_03 DEV (RGIERSIG on 2001-11-27)</option> <option value="/release/RGIERSIG/IO-Tty-0.92_02/view/Pty.pm" >0.92_02 DEV (RGIERSIG on 2001-11-26)</option> <option value="/release/RGIERSIG/IO-Tty-0.05/view/Pty.pm" >0.05 (RGIERSIG on 2001-09-06)</option> <option value="/release/GBARR/IO-Tty-0.03/view/Pty.pm" >0.03 (GBARR on 2000-03-29)</option> <option value="/release/GBARR/IO-Tty-0.02/view/Pty.pm" >0.02 (GBARR on 1997-03-21)</option> <option value="/release/GBARR/IO-Tty-0.01/view/Pty.pm" >0.01 (GBARR on 1997-03-20)</option> </optgroup> </select> </li> <li class="version-diff"> <select class="select-navigator form-control tool-bar-form"> <option disabled selected>Diff with version</option> <option disabled value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.20/Pty.pm" >1.20 (TODDR on 2023-12-28)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.19/Pty.pm" >1.19 (TODDR on 2023-12-28)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.17/Pty.pm" >1.17 (TODDR on 2022-11-11)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.16/Pty.pm" >1.16 (TODDR on 2021-01-22)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.15/Pty.pm" >1.15 (TODDR on 2020-11-03)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.14/Pty.pm" >1.14 (TODDR on 2020-01-19)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.13_01/Pty.pm" >1.13_01 DEV (TODDR on 2015-07-27)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.12/Pty.pm" >1.12 (TODDR on 2014-09-12)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.11/Pty.pm" >1.11 (TODDR on 2014-05-05)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-1.08/Pty.pm" >1.08 (RGIERSIG on 2009-02-24)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-1.07/Pty.pm" >1.07 (RGIERSIG on 2006-07-18)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-1.06/Pty.pm" >1.06 (RGIERSIG on 2006-07-17)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-1.05/Pty.pm" >1.05 (RGIERSIG on 2006-06-09)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-1.04/Pty.pm" >1.04 (RGIERSIG on 2006-05-31)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-1.03/Pty.pm" >1.03 (RGIERSIG on 2006-05-05)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-1.02/Pty.pm" >1.02 (RGIERSIG on 2002-04-02)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/GBARR/IO-Tty-0.04/Pty.pm" >0.04 (GBARR on 2000-09-04)</option> <optgroup label="BackPAN">' <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.18/Pty.pm" >1.18 (TODDR on 2023-11-28)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.11_01/Pty.pm" >1.11_01 DEV (TODDR on 2014-05-05)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.10/Pty.pm" >1.10 (TODDR on 2010-10-11)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.09_01/Pty.pm" >1.09_01 DEV (TODDR on 2010-10-05)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.09/Pty.pm" >1.09 (TODDR on 2010-10-04)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.08_03/Pty.pm" >1.08_03 DEV (TODDR on 2010-10-03)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.08_02/Pty.pm" >1.08_02 DEV (TODDR on 2010-09-10)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/TODDR/IO-Tty-1.08_01/Pty.pm" >1.08_01 DEV (TODDR on 2010-09-10)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-1.01/Pty.pm" >1.01 (RGIERSIG on 2002-03-19)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-1.00/Pty.pm" >1.00 (RGIERSIG on 2002-03-13)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-0.97_01/Pty.pm" >0.97_01 DEV (RGIERSIG on 2002-02-28)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-0.95_01/Pty.pm" >0.95_01 DEV (RGIERSIG on 2002-01-31)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-0.94_05/Pty.pm" >0.94_05 DEV (RGIERSIG on 2002-01-31)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-0.94_03/Pty.pm" >0.94_03 DEV (RGIERSIG on 2002-01-23)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-0.94_02/Pty.pm" >0.94_02 DEV (RGIERSIG on 2002-01-18)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-0.94_01/Pty.pm" >0.94_01 DEV (RGIERSIG on 2002-01-18)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-0.92_04/Pty.pm" >0.92_04 DEV (RGIERSIG on 2001-11-28)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-0.92_03/Pty.pm" >0.92_03 DEV (RGIERSIG on 2001-11-27)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-0.92_02/Pty.pm" >0.92_02 DEV (RGIERSIG on 2001-11-26)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/RGIERSIG/IO-Tty-0.05/Pty.pm" >0.05 (RGIERSIG on 2001-09-06)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/GBARR/IO-Tty-0.03/Pty.pm" >0.03 (GBARR on 2000-03-29)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/GBARR/IO-Tty-0.02/Pty.pm" >0.02 (GBARR on 1997-03-21)</option> <option value="/release/TODDR/IO-Tty-1.20/diff/GBARR/IO-Tty-0.01/Pty.pm" >0.01 (GBARR on 1997-03-20)</option> </optgroup> </select> </li> <li> <ul class="dependencies"> <li class="nav-header">Dependencies</li> <li><i class="ttip" title="dynamic_config enabled">unknown</i></li> <li> <hr> </li> <li> <a href="/module/IO::Pty/requires">Reverse dependencies</a> </li> <li> <a href="http://deps.cpantesters.org/?module=IO%3A%3APty">CPAN Testers List</a> </li> <li> <a href="https://cpandeps.grinnz.com/?dist=IO-Tty">Dependency graph</a> </li> </ul> </li> <li class="nav-header">Permalinks</li> <li> <a href="/release/TODDR/IO-Tty-1.20/view/Pty.pm">This version</a> </li> <li> <a href="/pod/IO::Pty">Latest version</a> </li> <li> <div class="plussers"> <div class="nav-header">++ed by:</div> <div> <a class="display-all" href="/author/PINGAN"><img src="https://www.gravatar.com/avatar/a02222e5e0e4fd24d52fc29a08ac6bcb?d=identicon&amp;s=20" title="PINGAN" alt="PINGAN"></a> <a class="display-all" href="/author/HANNIBAL"><img src="https://www.gravatar.com/avatar/325c153e70a65543b9496e0ad7cdca29?d=identicon&amp;s=20" title="HANNIBAL" alt="HANNIBAL"></a> <a class="display-all" href="/author/KEEDI"><img src="https://www.gravatar.com/avatar/95f905a7a4ccc573c711e9d264c0fde8?d=identicon&amp;s=20" title="KEEDI" alt="KEEDI"></a> <a class="display-all" href="/author/RWP"><img src="https://www.gravatar.com/avatar/7110eb2389e69a066d9d7cad7a1cc2bf?d=identicon&amp;s=20" title="RWP" alt="RWP"></a> <a class="display-all" href="/author/PETDANCE"><img src="https://www.gravatar.com/avatar/8077a0584e451732420d43f5d0b3bd31?d=identicon&amp;s=20" title="PETDANCE" alt="PETDANCE"></a> </div> <!-- Display counts of plussers--> <div> <a href="/dist/IO-Tty/plussers">5 PAUSE users</a> </div> <div> 4 non-PAUSE users </div> </div> </li> <li> <div> <button class="contributors-show-button btn-link">and 1 contributors</button> <div id="metacpan_contributors" class="slide-out slide-out-hidden"> <div> <ul> <li class="contributor" data-cpan-author="RGIERSIG" data-contrib-email="RGiersig@cpan.org" > <a href="/author/RGIERSIG" class="cpan-author"> <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/2c59cbd332368e1df0ff0ca6c212913e?d=identicon&amp;s=20" /> Roland Giersig </a> </li> </ul> </div> </div> </div> </li> </ul> </div> </nav> <div class="content-navigation"> <div class="breadcrumbs"> <span> <a data-keyboard-shortcut="g a" rel="author" href="/author/TODDR" class="author-name">Todd Rinaldo</a> </span> <span>&nbsp;/&nbsp;</span> <div class="release dist-release status-latest maturity-released"> <span class="dropdown"><b class="caret"></b></span> <select class="select-navigator "> <option selected value="/release/TODDR/IO-Tty-1.20/view/Pty.pm" >1.20 (TODDR on 2023-12-28)</option> <option value="/release/TODDR/IO-Tty-1.19/view/Pty.pm" >1.19 (TODDR on 2023-12-28)</option> <option value="/release/TODDR/IO-Tty-1.17/view/Pty.pm" >1.17 (TODDR on 2022-11-11)</option> <option value="/release/TODDR/IO-Tty-1.16/view/Pty.pm" >1.16 (TODDR on 2021-01-22)</option> <option value="/release/TODDR/IO-Tty-1.15/view/Pty.pm" >1.15 (TODDR on 2020-11-03)</option> <option value="/release/TODDR/IO-Tty-1.14/view/Pty.pm" >1.14 (TODDR on 2020-01-19)</option> <option value="/release/TODDR/IO-Tty-1.13_01/view/Pty.pm" >1.13_01 DEV (TODDR on 2015-07-27)</option> <option value="/release/TODDR/IO-Tty-1.12/view/Pty.pm" >1.12 (TODDR on 2014-09-12)</option> <option value="/release/TODDR/IO-Tty-1.11/view/Pty.pm" >1.11 (TODDR on 2014-05-05)</option> <option value="/release/RGIERSIG/IO-Tty-1.08/view/Pty.pm" >1.08 (RGIERSIG on 2009-02-24)</option> <option value="/release/RGIERSIG/IO-Tty-1.07/view/Pty.pm" >1.07 (RGIERSIG on 2006-07-18)</option> <option value="/release/RGIERSIG/IO-Tty-1.06/view/Pty.pm" >1.06 (RGIERSIG on 2006-07-17)</option> <option value="/release/RGIERSIG/IO-Tty-1.05/view/Pty.pm" >1.05 (RGIERSIG on 2006-06-09)</option> <option value="/release/RGIERSIG/IO-Tty-1.04/view/Pty.pm" >1.04 (RGIERSIG on 2006-05-31)</option> <option value="/release/RGIERSIG/IO-Tty-1.03/view/Pty.pm" >1.03 (RGIERSIG on 2006-05-05)</option> <option value="/release/RGIERSIG/IO-Tty-1.02/view/Pty.pm" >1.02 (RGIERSIG on 2002-04-02)</option> <option value="/release/GBARR/IO-Tty-0.04/view/Pty.pm" >0.04 (GBARR on 2000-09-04)</option> <optgroup label="BackPAN">' <option value="/release/TODDR/IO-Tty-1.18/view/Pty.pm" >1.18 (TODDR on 2023-11-28)</option> <option value="/release/TODDR/IO-Tty-1.11_01/view/Pty.pm" >1.11_01 DEV (TODDR on 2014-05-05)</option> <option value="/release/TODDR/IO-Tty-1.10/view/Pty.pm" >1.10 (TODDR on 2010-10-11)</option> <option value="/release/TODDR/IO-Tty-1.09_01/view/Pty.pm" >1.09_01 DEV (TODDR on 2010-10-05)</option> <option value="/release/TODDR/IO-Tty-1.09/view/Pty.pm" >1.09 (TODDR on 2010-10-04)</option> <option value="/release/TODDR/IO-Tty-1.08_03/view/Pty.pm" >1.08_03 DEV (TODDR on 2010-10-03)</option> <option value="/release/TODDR/IO-Tty-1.08_02/view/Pty.pm" >1.08_02 DEV (TODDR on 2010-09-10)</option> <option value="/release/TODDR/IO-Tty-1.08_01/view/Pty.pm" >1.08_01 DEV (TODDR on 2010-09-10)</option> <option value="/release/RGIERSIG/IO-Tty-1.01/view/Pty.pm" >1.01 (RGIERSIG on 2002-03-19)</option> <option value="/release/RGIERSIG/IO-Tty-1.00/view/Pty.pm" >1.00 (RGIERSIG on 2002-03-13)</option> <option value="/release/RGIERSIG/IO-Tty-0.97_01/view/Pty.pm" >0.97_01 DEV (RGIERSIG on 2002-02-28)</option> <option value="/release/RGIERSIG/IO-Tty-0.95_01/view/Pty.pm" >0.95_01 DEV (RGIERSIG on 2002-01-31)</option> <option value="/release/RGIERSIG/IO-Tty-0.94_05/view/Pty.pm" >0.94_05 DEV (RGIERSIG on 2002-01-31)</option> <option value="/release/RGIERSIG/IO-Tty-0.94_03/view/Pty.pm" >0.94_03 DEV (RGIERSIG on 2002-01-23)</option> <option value="/release/RGIERSIG/IO-Tty-0.94_02/view/Pty.pm" >0.94_02 DEV (RGIERSIG on 2002-01-18)</option> <option value="/release/RGIERSIG/IO-Tty-0.94_01/view/Pty.pm" >0.94_01 DEV (RGIERSIG on 2002-01-18)</option> <option value="/release/RGIERSIG/IO-Tty-0.92_04/view/Pty.pm" >0.92_04 DEV (RGIERSIG on 2001-11-28)</option> <option value="/release/RGIERSIG/IO-Tty-0.92_03/view/Pty.pm" >0.92_03 DEV (RGIERSIG on 2001-11-27)</option> <option value="/release/RGIERSIG/IO-Tty-0.92_02/view/Pty.pm" >0.92_02 DEV (RGIERSIG on 2001-11-26)</option> <option value="/release/RGIERSIG/IO-Tty-0.05/view/Pty.pm" >0.05 (RGIERSIG on 2001-09-06)</option> <option value="/release/GBARR/IO-Tty-0.03/view/Pty.pm" >0.03 (GBARR on 2000-03-29)</option> <option value="/release/GBARR/IO-Tty-0.02/view/Pty.pm" >0.02 (GBARR on 1997-03-21)</option> <option value="/release/GBARR/IO-Tty-0.01/view/Pty.pm" >0.01 (GBARR on 1997-03-20)</option> </optgroup> </select> <a data-keyboard-shortcut="g d" class="release-name" href="/dist/IO-Tty">IO-Tty-1.20</a> </div> <span class="river-gauge-gauge"> <svg width="24px" height="15px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g> <title> River stage four &#10; • 35 direct dependents &#10; • 2559 total dependents </title> <rect x="0" y="0" width="4" height="15" fill="#7ea3f2" /> <rect x="5" y="0" width="4" height="15" fill="#7ea3f2" /> <rect x="10" y="0" width="4" height="15" fill="#7ea3f2" /> <rect x="15" y="0" width="4" height="15" fill="#7ea3f2" /> <rect x="20" y="0" width="4" height="15" fill="#e4e2e2" /> </g> </svg> </span> <div id="IO-Tty-fav" class="show-logged-in"> <form action="/account/favorite/add" style="display: inline" method="POST"> <input type="hidden" name="remove" value="0"> <input type="hidden" name="release" value="IO-Tty-1.20"> <input type="hidden" name="author" value="TODDR"> <input type="hidden" name="distribution" value="IO-Tty"> <button type="submit" class="favorite highlight"><span>9</span> ++</button> </form> </div> <div class="show-logged-out"> <button class="fav-not-logged-in favorite highlight"><span>9</span> ++</button> </div> / <span>IO::Pty</span> </div> </div> <main class="content"> <nav class="toc"> <div class="toc-header"><strong>Contents</strong></div> <ul> <li><a href="#NAME">NAME</a></li> <li><a href="#VERSION">VERSION</a></li> <li><a href="#SYNOPSIS">SYNOPSIS</a></li> <li><a href="#DESCRIPTION">DESCRIPTION</a></li> <li><a href="#CONSTRUCTOR">CONSTRUCTOR</a></li> <li><a href="#METHODS">METHODS</a></li> <li><a href="#SEE-ALSO">SEE ALSO</a></li> <li><a href="#MAILING-LISTS">MAILING LISTS</a></li> <li><a href="#AUTHORS">AUTHORS</a></li> <li><a href="#COPYRIGHT">COPYRIGHT</a></li> <li><a href="#DISCLAIMER">DISCLAIMER</a></li> </ul></nav> <div class="pod anchors"> <h1 id="NAME">NAME</h1> <p>IO::Pty - Pseudo TTY object class</p> <h1 id="VERSION">VERSION</h1> <p>1.20</p> <h1 id="SYNOPSIS">SYNOPSIS</h1> <pre><code> use IO::Pty; $pty = new IO::Pty; $slave = $pty-&gt;slave; foreach $val (1..10) { print $pty &quot;$val\n&quot;; $_ = &lt;$slave&gt;; print &quot;$_&quot;; } close($slave);</code></pre> <h1 id="DESCRIPTION">DESCRIPTION</h1> <p><code>IO::Pty</code> provides an interface to allow the creation of a pseudo tty.</p> <p><code>IO::Pty</code> inherits from <code>IO::Handle</code> and so provide all the methods defined by the <code>IO::Handle</code> package.</p> <p>Please note that pty creation is very system-dependent. If you have problems, see <a href="/pod/IO::Tty">IO::Tty</a> for help.</p> <h1 id="CONSTRUCTOR">CONSTRUCTOR</h1> <dl> <dt id="new">new</dt> <dd> <p>The <code>new</code> constructor takes no arguments and returns a new file object which is the master side of the pseudo tty.</p> </dd> </dl> <h1 id="METHODS">METHODS</h1> <dl> <dt id="ttyname()"><a id="ttyname"></a>ttyname()</dt> <dd> <p>Returns the name of the slave pseudo tty. On UNIX machines this will be the pathname of the device. Use this name for informational purpose only, to get a slave filehandle, use slave().</p> </dd> <dt id="slave()"><a id="slave"></a>slave()</dt> <dd> <p>The <code>slave</code> method will return the slave filehandle of the given master pty, opening it anew if necessary. If IO::Stty is installed, you can then call <code>$slave-&gt;stty()</code> to modify the terminal settings.</p> </dd> <dt id="close_slave()"><a id="close_slave"></a>close_slave()</dt> <dd> <p>The slave filehandle will be closed and destroyed. This is necessary in the parent after forking to get rid of the open filehandle, otherwise the parent will not notice if the child exits. Subsequent calls of <code>slave()</code> will return a newly opened slave filehandle.</p> </dd> <dt id="make_slave_controlling_terminal()"><a id="make_slave_controlling_terminal"></a>make_slave_controlling_terminal()</dt> <dd> <p>This will set the slave filehandle as the controlling terminal of the current process, which will become a session leader, so this should only be called by a child process after a fork(), e.g. in the callback to <code>sync_exec()</code> (see <a href="/pod/Proc::SyncExec">Proc::SyncExec</a>). See the <code>try</code> script (also <code>test.pl</code>) for an example how to correctly spawn a subprocess.</p> </dd> <dt id="set_raw()"><a id="set_raw"></a>set_raw()</dt> <dd> <p>Will set the pty to raw. Note that this is a one-way operation, you need IO::Stty to set the terminal settings to anything else.</p> <p>On some systems, the master pty is not a tty. This method checks for that and returns success anyway on such systems. Note that this method must be called on the slave, and probably should be called on the master, just to be sure, i.e.</p> <pre><code>$pty-&gt;slave-&gt;set_raw(); $pty-&gt;set_raw();</code></pre> </dd> <dt id="clone_winsize_from(\*FH)"><a id="clone_winsize_from"></a><a id="clone_winsize_from-FH"></a>clone_winsize_from(\*FH)</dt> <dd> <p>Gets the terminal size from filehandle FH (which must be a terminal) and transfers it to the pty. Returns true on success and undef on failure. Note that this must be called upon the <i>slave</i>, i.e.</p> <pre><code>$pty-&gt;slave-&gt;clone_winsize_from(\*STDIN);</code></pre> <p>On some systems, the master pty also isatty. I actually have no idea if setting terminal sizes there is passed through to the slave, so if this method is called for a master that is not a tty, it silently returns OK.</p> <p>See the <code>try</code> script for example code how to propagate SIGWINCH.</p> </dd> <dt id="get_winsize()"><a id="get_winsize"></a>get_winsize()</dt> <dd> <p>Returns the terminal size, in a 4-element list.</p> <pre><code>($row, $col, $xpixel, $ypixel) = $tty-&gt;get_winsize()</code></pre> </dd> <dt id="set_winsize($row,-$col,-$xpixel,-$ypixel)"><a id="set_winsize"></a><a id="set_winsize-row-col-xpixel-ypixel"></a>set_winsize($row, $col, $xpixel, $ypixel)</dt> <dd> <p>Sets the terminal size. If not specified, <code>$xpixel</code> and <code>$ypixel</code> are set to 0. As with <code>clone_winsize_from</code>, this must be called upon the <i>slave</i>.</p> </dd> </dl> <h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1> <p><a href="/pod/IO::Tty">IO::Tty</a>, <a href="/pod/IO::Tty::Constant">IO::Tty::Constant</a>, <a href="/pod/IO::Handle">IO::Handle</a>, <a href="/pod/Expect">Expect</a>, <a href="/pod/Proc::SyncExec">Proc::SyncExec</a></p> <h1 id="MAILING-LISTS"><a id="MAILING"></a>MAILING LISTS</h1> <p>As this module is mainly used by Expect, support for it is available via the two Expect mailing lists, expectperl-announce and expectperl-discuss, at</p> <pre><code>http://lists.sourceforge.net/lists/listinfo/expectperl-announce</code></pre> <p>and</p> <pre><code>http://lists.sourceforge.net/lists/listinfo/expectperl-discuss</code></pre> <h1 id="AUTHORS">AUTHORS</h1> <p>Originally by Graham Barr &lt;<i>gbarr@pobox.com</i>&gt;, based on the Ptty module by Nick Ing-Simmons &lt;<i>nik@tiuk.ti.com</i>&gt;.</p> <p>Now maintained and heavily rewritten by Roland Giersig &lt;<i>RGiersig@cpan.org</i>&gt;.</p> <p>Contains copyrighted stuff from openssh v3.0p1, authored by Tatu Ylonen &lt;ylo@cs.hut.fi&gt;, Markus Friedl and Todd C. Miller &lt;Todd.Miller@courtesan.com&gt;.</p> <h1 id="COPYRIGHT">COPYRIGHT</h1> <p>Now all code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p> <p>Nevertheless the above AUTHORS retain their copyrights to the various parts and want to receive credit if their source code is used. See the source for details.</p> <h1 id="DISCLAIMER">DISCLAIMER</h1> <p>THIS SOFTWARE IS PROVIDED ``AS IS&#39;&#39; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p> <p>In other words: Use at your own risk. Provided as is. Your mileage may vary. Read the source, Luke!</p> <p>And finally, just to be sure:</p> <p>Any Use of This Product, in Any Manner Whatsoever, Will Increase the Amount of Disorder in the Universe. Although No Liability Is Implied Herein, the Consumer Is Warned That This Process Will Ultimately Lead to the Heat Death of the Universe.</p></div> <div id="metacpan_install-instructions-dialog" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title">Module Install Instructions</h4> </div> <div class="modal-body"> <p>To install IO::Tty, copy and paste the appropriate command in to your terminal.</p> <p><a href="/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p> <pre><code>cpanm IO::Tty</code></pre> <p><a href="/pod/CPAN">CPAN shell</a></p> <pre><code>perl -MCPAN -e shell install IO::Tty</code></pre> <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p> </div> <div class="modal-footer"> <a href="#" data-dismiss="modal" class="btn">Close</a> </div> </div> </div> </div> </main> <div class="content-pagination"> </div> </div> <footer class="footer"> <div class="footer-container"> <div class="footer-social"> <div class="footer-link footer-logo"> <a href="/"> <img src="/static/images/metacpan-logo.svg" alt="MetaCPAN" /> </a> </div> <a class="footer-social-link" href="https://github.com/metacpan"> <i class="fab fa-github-square"></i> </a> <a class="footer-social-link" href="https://fosstodon.org/@metacpan"> <i class="fab fa-mastodon"></i> </a> </div> <div class="footer-links"> <div class="footer-link"> <a href="/about">About</a> </div> <div class="footer-link"> <a href="/about/sponsors">Sponsor</a> </div> <div class="footer-link"> <a href="https://grep.metacpan.org">grep::cpan</a> </div> <div class="footer-link"> <a href="/recent">Recent</a> </div> <div class="footer-link"> <a href="/about/faq">FAQ</a> </div> <div class="footer-link"> <a href="/tools">Tools</a> </div> <div class="footer-link"> <a href="https://fastapi.metacpan.org/">API</a> </div> <div class="footer-link"> <a href="https://www.perl.org/">Perl.org</a> </div> </div> <div class="footer-sponsors"> <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener"> <img class="footer-sponsor-bytemark" src="/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo"> </a> <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener"> <img class="footer-sponsor-liquidweb" src="/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo"> </a> <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener"> <img class="footer-sponsor-deriv" src="/static/images/sponsors/deriv.svg" alt="Deriv logo"> </a> <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener"> <img class="footer-sponsor-geocode" src="/static/images/sponsors/geocodelogo.svg" alt="Geocode logo"> </a> <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener"> <img class="footer-sponsor-fastly" src="/static/images/sponsors/fastly_logo.svg" alt="Fastly logo"> </a> <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener"> <img class="footer-sponsor-opencage" src="/static/images/sponsors/open-cage.svg" alt="OpenCage logo"> </a> <!-- Added 2024-07-22 --> <a class="footer-sponsor-link" target="_blank" href="https://www.elastic.co/" rel="noopener"> <img class="footer-sponsor-elastic" src="/static/images/sponsors/elastic.svg" alt="Elastic logo"> </a> <!-- Added 2024-07-22 --> <a class="footer-sponsor-link" target="_blank" href="https://route4me.com/" rel="noopener"> <img class="footer-sponsor-route4me" src="/static/images/sponsors/route4me.png" alt="Route4Me logo"> </a> </div> </div> </footer> <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Keyboard Shortcuts</h4> </div> <div class="modal-body row"> <div class="col-md-6"> <table class="table keyboard-shortcuts"> <thead> <tr> <th></th> <th>Global</th> </tr> </thead> <tbody> <tr> <td class="keys"> <kbd>s</kbd> </td> <td>Focus search bar</td> </tr> <tr> <td class="keys"> <kbd>?</kbd> </td> <td>Bring up this help dialog</td> </tr> </tbody> </table> <table class="table keyboard-shortcuts"> <thead> <tr> <th></th> <th>GitHub</th> </tr> </thead> <tbody> <tr> <td class="keys"> <kbd>g</kbd> <kbd>p</kbd> </td> <td>Go to pull requests</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>i</kbd> </td> <td>go to github issues (only if github is preferred repository)</td> </tr> </tbody> </table> </div> <div class="col-md-6"> <table class="table keyboard-shortcuts"> <thead> <tr> <th></th> <th>POD</th> </tr> </thead> <tbody> <tr> <td class="keys"> <kbd>g</kbd> <kbd>a</kbd> </td> <td>Go to author</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>c</kbd> </td> <td>Go to changes</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>i</kbd> </td> <td>Go to issues</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>d</kbd> </td> <td>Go to dist</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>r</kbd> </td> <td>Go to repository/SCM</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>s</kbd> </td> <td>Go to source</td> </tr> <tr> <td class="keys"> <kbd>g</kbd> <kbd>b</kbd> </td> <td>Go to file browse</td> </tr> </tbody> </table> </div> <div class="col-md-12"> <table class="table keyboard-shortcuts"> <thead> <tr> <th></th> <th>Search terms</th> </tr> </thead> <tbody> <tr> <td><em>module:</em> (e.g. <a href="/search?q=module%3APlugin">module:Plugin</a>)</td> </tr> <tr> <td><em>distribution:</em> (e.g. <a href="/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td> </tr> <tr> <td><em>author:</em> (e.g. <a href="/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td> </tr> <tr> <td><em>version:</em> (e.g. <a href="/search?q=version%3A1.00">version:1.00</a>)</td> </tr> </tbody> </table> </div> </div> <div class="modal-footer"></div> </div> </div> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10