• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Konsole

  • Konsole
  • Pty
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
Konsole::Pty Class Reference

#include <Pty.h>

Inheritance diagram for Konsole::Pty:
Inheritance graph
[legend]

Public Slots

void sendData (const char *buffer, int length)
 
void setUtf8Mode (bool on)
 

Signals

void receivedData (const char *buffer, int length)
 

Public Member Functions

 Pty (QObject *parent=0)
 
 Pty (int ptyMasterFd, QObject *parent=0)
 
 ~Pty ()
 
void closePty ()
 
char eraseChar () const
 
bool flowControlEnabled () const
 
int foregroundProcessGroup () const
 
void setEraseChar (char eraseChar)
 
void setFlowControlEnabled (bool on)
 
void setInitialWorkingDirectory (const QString &dir)
 
void setWindowSize (int columns, int lines)
 
void setWriteable (bool writeable)
 
int start (const QString &program, const QStringList &arguments, const QStringList &environment)
 
QSize windowSize () const
 

Protected Member Functions

void setupChildProcess ()
 

Detailed Description

The Pty class is used to start the terminal process, send data to it, receive data from it and manipulate various properties of the pseudo-teletype interface used to communicate with the process.

To use this class, construct an instance and connect to the sendData slot and receivedData signal to send data to or receive data from the process.

To start the terminal process, call the start() method with the program name and appropriate arguments.

Definition at line 52 of file Pty.h.

Constructor & Destructor Documentation

Pty::Pty ( QObject *  parent = 0)
explicit

Constructs a new Pty.

Connect to the sendData() slot and receivedData() signal to prepare for sending and receiving data from the terminal process.

To start the terminal process, call the run() method with the name of the program to start and appropriate arguments.

Definition at line 44 of file Pty.cpp.

Pty::Pty ( int  ptyMasterFd,
QObject *  parent = 0 
)
explicit

Construct a process using an open pty master.

See KPtyProcess::KPtyProcess()

Definition at line 38 of file Pty.cpp.

Pty::~Pty ( )

Definition at line 70 of file Pty.cpp.

Member Function Documentation

void Pty::closePty ( )

Close the underlying pty master/slave pair.

Definition at line 277 of file Pty.cpp.

char Pty::eraseChar ( ) const

Definition at line 170 of file Pty.cpp.

bool Pty::flowControlEnabled ( ) const

Queries the terminal state and returns true if Xon/Xoff flow control is enabled.

Definition at line 122 of file Pty.cpp.

int Pty::foregroundProcessGroup ( ) const

Returns the process id of the teletype's current foreground process.

This is the process which is currently reading input sent to the terminal via. sendData()

If there is a problem reading the foreground process group, 0 will be returned.

Definition at line 282 of file Pty.cpp.

void Konsole::Pty::receivedData ( const char *  buffer,
int  length 
)
signal

Emitted when a new block of data is received from the teletype.

Parameters
bufferPointer to the data received.
lengthLength of buffer
void Pty::sendData ( const char *  buffer,
int  length 
)
slot

Sends data to the process currently controlling the teletype ( whose id is returned by foregroundProcessGroup() )

Parameters
bufferPointer to the data to send.
lengthLength of buffer.

Definition at line 74 of file Pty.cpp.

void Pty::setEraseChar ( char  eraseChar)

Sets the special character for erasing previous not-yet-erased character.

See termios(3) for detailed description.

Definition at line 156 of file Pty.cpp.

void Pty::setFlowControlEnabled ( bool  on)

Enables or disables Xon/Xoff flow control.

The flow control setting may be changed later by a terminal application, so flowControlEnabled() may not equal the value of on in the previous call to setFlowControlEnabled()

Definition at line 105 of file Pty.cpp.

void Pty::setInitialWorkingDirectory ( const QString &  dir)

Sets the initial working directory.

Definition at line 182 of file Pty.cpp.

void Pty::setupChildProcess ( )
protected

Definition at line 293 of file Pty.cpp.

void Pty::setUtf8Mode ( bool  on)
slot

Put the pty into UTF-8 mode on systems which support it.

Definition at line 135 of file Pty.cpp.

void Pty::setWindowSize ( int  columns,
int  lines 
)

Sets the size of the window (in columns and lines of characters) used by this teletype.

Definition at line 91 of file Pty.cpp.

void Pty::setWriteable ( bool  writeable)

Control whether the pty device is writeable by group members.

Definition at line 261 of file Pty.cpp.

int Pty::start ( const QString &  program,
const QStringList &  arguments,
const QStringList &  environment 
)

Starts the terminal process.

Returns 0 if the process was started successfully or non-zero otherwise.

Parameters
programPath to the program to start
argumentsArguments to pass to the program being started
environmentA list of key=value pairs which will be added to the environment for the new process. At the very least this should include an assignment for the TERM environment variable.

Definition at line 225 of file Pty.cpp.

QSize Pty::windowSize ( ) const

Returns the size of the window used by this teletype.

See setWindowSize()

Definition at line 100 of file Pty.cpp.


The documentation for this class was generated from the following files:
  • Pty.h
  • Pty.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal