Home

ConPTY

ConPTY, short for Windows Pseudo Console, is a Windows API introduced by Microsoft to enable modern terminal emulation by providing a pseudo terminal that connects a host process to a child process running a console application. It is designed to give terminal applications a stable, high-level interface for handling input, output, and sizing, while allowing the host to render the terminal UI.

ConPTY was released as part of Windows 10 and has been used to support contemporary terminal experiences

In operation, a host creates a pseudo console object and sets its initial screen size. It then

ConPTY has been integral to modern Windows terminals, such as Windows Terminal, and is used to support

on
Windows,
including
Windows
Terminal.
It
provides
a
separation
between
the
host
application
(such
as
a
terminal
emulator)
and
the
console
application
running
inside
the
pseudo
console.
This
design
allows
host
processes
to
interpret
and
render
ANSI
escape
sequences,
manage
line
discipline,
and
implement
features
such
as
resizing
and
input
handling
without
requiring
direct
access
to
the
child
process’s
console
subsystem.
establishes
bidirectional
communication
channels
(often
via
pipes)
to
connect
the
host
with
the
guest
process,
which
runs
a
command-line
application
with
its
standard
input
and
output
redirected
to
the
pseudo
console.
The
host
is
responsible
for
presenting
the
terminal
UI
to
the
user
and
for
propagating
user
input
to
the
guest
process,
while
the
guest
writes
output
that
the
host
renders.
The
host
can
resize
the
pseudo
console,
and
the
guest
process
receives
these
events,
allowing
dynamic
terminal
sizing.
compatibility
with
traditional
console
applications
while
enabling
enhanced
rendering
and
richer
terminal
features
on
Windows.