8#ifndef KDESUPTYPROCESS_H
9#define KDESUPTYPROCESS_H
19#include <kdesu/kdesu_export.h>
25class PtyProcessPrivate;
56 int exec(
const QByteArray &command,
const QList<QByteArray> &args);
81 void writeLine(
const QByteArray &line,
bool addNewline =
true);
88 void unreadLine(
const QByteArray &line,
bool addNewline =
true);
108#if KDESU_ENABLE_DEPRECATED_SINCE(5, 0)
112 KDESU_DEPRECATED_VERSION(5, 0,
"Use PtyProcess::waitSlave()")
189 QList<QByteArray> environment()
const;
208 std::unique_ptr<PtyProcessPrivate>
const d;
Synchronous communication with tty programs.
Definition: ptyprocess.h:36
QByteArray m_command
Unused.
Definition: ptyprocess.h:197
static int waitMS(int fd, int ms)
Wait ms milliseconds (ie.
int waitSlave()
Waits until the pty has cleared the ECHO flag.
void setExitString(const QByteArray &exit)
Sets the exit string.
int m_pid
PID of child process.
Definition: ptyprocess.h:196
bool m_erase
Definition: ptyprocess.h:192
int pid() const
Returns the pid of the process.
QByteArray readLine(bool block=true)
Reads a line from the program's standard out.
checkPidStatus
Error return values for checkPidExited()
Definition: ptyprocess.h:39
static bool checkPid(pid_t pid)
Basic check for the existence of pid.
virtual void virtual_hook(int id, void *data)
Standard hack to add virtual methods in a BC way.
QByteArray m_exitString
String to scan for in output that indicates child has exited.
Definition: ptyprocess.h:198
QByteArray readAll(bool block=true)
Read all available output from the program's standard out.
int exec(const QByteArray &command, const QList< QByteArray > &args)
Forks off and execute a command.
static int checkPidExited(pid_t pid)
Check process exit status for process pid.
bool m_terminal
Indicates running in a terminal, causes additional newlines to be printed after output.
Definition: ptyprocess.h:193
void setEnvironment(const QList< QByteArray > &env)
Set additinal environment variables.
void setErase(bool erase)
Overwrites the password as soon as it is used.
int fd() const
Returns the filedescriptor of the process.
void writeLine(const QByteArray &line, bool addNewline=true)
Writes a line of text to the program's standard in.
int waitForChild()
Waits for the child to exit.
int enableLocalEcho(bool enable=true)
Enables/disables local echo on the pseudo tty.
void unreadLine(const QByteArray &line, bool addNewline=true)
Puts back a line of input.
void setTerminal(bool terminal)
Enables/disables terminal output.
Executes a remote command, using ssh.
Definition: sshprocess.h:24
Chat with kdesu_stub.
Definition: stubprocess.h:33
Executes a command under elevated privileges, using su.
Definition: suprocess.h:24