# class KPtyProcess

###

Table of contents
Modules
kdecore Classes
All Classes

Module | kdecore
Namespace | global
Class | KPtyProcess
Inherits | KProcess

This class extends KProcess by support for PTYs (pseudo TTYs).

The PTY is opened as soon as the class is instantiated. Verify that it was opened successfully by checking that pty()->masterFd() is not -1.

The PTY is always made the process' controlling TTY. Utmp registration and connecting the stdio handles to the PTY are optional.

No attempt to integrate with QProcess' waitFor*() functions was made, for it is impossible. Note that execute() does not work with the PTY, too. Use the PTY device's waitFor*() functions or use it asynchronously.

Author Oswald Buddenhagen <ossi@kde.org>

### enums

- PtyChannelFlag = { NoChannels, StdinChannel, StdoutChannel, StderrChannel, AllOutputChannels, AllChannels }

enum details

### methods

- KPtyProcess (parent)

  returns a KPtyProcess object

  Argument | Type | Default
  --- | --- | ---
  parent | QObject | None

  Constructor

- isUseUtmp ()

  returns (bool)

  Get whether to register the process as a TTY login in utmp.

  Returns whether to register in utmp

- pty ()

  returns (KPtyDevice)

  Get the PTY device of this process.

  Returns the PTY device

- ptyChannels ()

  returns (KPtyProcess.PtyChannels)

  Query to which channels the PTY is assigned.

  Returns the output channel handling mode

- setPtyChannels (channels)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  channels | KPtyProcess.PtyChannels |

  Set to which channels the PTY should be assigned.

  This function must be called before starting the process.

  channels - the output channel handling mode

- setUseUtmp (value)

  returns nothing

  Argument | Type | Default
  --- | --- | ---
  value | bool |

  Set whether to register the process as a TTY login in utmp.

  Utmp is disabled by default. It should enabled for interactively fed processes, like terminal emulations.

  This function must be called before starting the process.

  value - whether to register in utmp.

- setupChildProcess ()

  returns nothing

### enums - detail

- PtyChannelFlag = { NoChannels, StdinChannel, StdoutChannel, StderrChannel, AllOutputChannels, AllChannels }

  | NoChannels | - | NoChannels = 0, < The PTY is not connected to any channel.
  | StdinChannel | - | StdinChannel = 1, < Connect PTY to stdin.
  | StdoutChannel | - | StdoutChannel = 2, < Connect PTY to stdout.
  | StderrChannel | - | StderrChannel = 4, < Connect PTY to stderr.
  | AllOutputChannels | - | AllOutputChannels = 6, < Connect PTY to all output channels.
  | AllChannels | - | AllChannels = 7 < Connect PTY to all channels.