Konsole
Session.cpp
Go to the documentation of this file.
124 QDBusConnection::sessionBus().registerObject(QLatin1String("/Sessions/") + QString::number(_sessionId), this);
405 static const QByteArray warningText = i18nc("@info:shell Alert the user with red color text", "Warning: ").toLocal8Bit();
467 terminalWarning(i18n("Could not find '%1', starting '%2' instead. Please check your profile settings.", _program, exec));
508 terminalWarning(i18n("Could not start program '%1' with arguments '%2'.", exec, arguments.join(" ")));
607 //FIXME: The idea here is that the notification popup will appear to tell the user than output from
613 //FIXME: Make message text for this notification and the activity notification more descriptive.
Definition: Emulation.h:65
QString keyBindings() const
Returns the name of the key bindings used by this session.
void setHistory(const HistoryType &)
Sets the history store used by this emulation.
Definition: Emulation.cpp:137
void startZModem(const QString &rz, const QString &dir, const QStringList &list)
Definition: Session.cpp:1183
Q_SCRIPTABLE void setMonitorActivity(bool)
Enables monitoring for activity in the session.
Definition: Session.cpp:1101
Definition: Session.h:355
Represents a terminal session consisting of a pseudo-teletype and a terminal emulation.
Definition: Session.h:78
void restoreSession(KConfigGroup &group)
Definition: Session.cpp:1434
QString & append(QChar ch)
Q_SCRIPTABLE int foregroundProcessId()
Returns the process id of the terminal's foreground process.
Definition: Session.cpp:1393
void sendData(const char *buffer, int length)
Sends data to the process currently controlling the teletype ( whose id is returned by foregroundProc...
Definition: Pty.cpp:74
Q_SCRIPTABLE void setEnvironment(const QStringList &environment)
Sets the environment for this session.
Definition: Session.cpp:889
int foregroundProcessGroup() const
Returns the process id of the teletype's current foreground process.
Definition: Pty.cpp:282
bool isHidden() const
int width() const
void currentDirectoryChanged(const QString &dir)
Emitted when the current working directory of this session changes.
virtual bool isEnabled() const =0
Returns true if the history is enabled ( can store lines of output ) or false otherwise.
void setAddToUtmp(bool)
Specifies whether a utmp entry should be created for the pty used by this session.
Definition: Session.cpp:1138
virtual void setImageSize(int lines, int columns)
Change the size of the emulation's image.
Definition: Emulation.cpp:338
Q_SCRIPTABLE QString shellSessionId() const
Returns the "friendly" version of the QUuid of this session.
Definition: Session.cpp:419
virtual QByteArray name() const =0
static QString expand(const QString &text)
Expands environment variables in text .
Definition: ShellCommand.cpp:74
Q_SCRIPTABLE void sendMouseEvent(int buttons, int column, int line, int eventType)
Sends a mouse event of type eventType emitted by button buttons on column/line to the current foregro...
Definition: Session.cpp:829
Q_SCRIPTABLE int processId() const
Returns the process id of the terminal process.
int start(const QString &program, const QStringList &arguments, const QStringList &environment)
Starts the terminal process.
Definition: Pty.cpp:225
Q_SCRIPTABLE int historySize() const
Returns the history capacity of this session.
Definition: Session.cpp:1378
QString currentDir(bool *ok) const
Returns the current working directory of the process.
Definition: ProcessInfo.cpp:300
virtual int maximumLineCount() const =0
Returns the maximum number of lines which this history type can store or -1 if the history can store ...
void processFilters()
Updates the filters in the display's filter chain.
Definition: TerminalDisplay.cpp:944
void setEraseChar(char eraseChar)
Sets the special character for erasing previous not-yet-erased character.
Definition: Pty.cpp:156
Definition: History.h:348
QObject * sender() const
Definition: ZModemDialog.h:29
void setPreferredSize(const QSize &size)
Definition: Session.cpp:1303
QSize imageSize() const
Returns the size of the screen image which the emulation produces.
Definition: Emulation.cpp:378
QSize windowSize() const
Returns the size of the window used by this teletype.
Definition: Pty.cpp:100
void outputSuspended(bool suspended)
Causes the widget to display or hide a message informing the user that terminal output has been suspe...
Definition: TerminalDisplay.cpp:2884
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
bool isEmpty() const
QList< Session * > sessions() const
Returns the list of sessions currently in the group.
Definition: Session.cpp:1461
void refresh()
Attempts to get the shell program to redraw the current display area.
Definition: Session.cpp:719
void setBracketedPasteMode(bool bracketedPasteMode)
Definition: TerminalDisplay.cpp:2686
The title of the session which is displayed in tabs etc.
Definition: Session.h:255
Definition: History.h:373
int foregroundPid(bool *ok) const
Returns the id of the current foreground process.
Definition: ProcessInfo.cpp:226
bool masterStatus(Session *session) const
Returns the master status of a session.
Definition: Session.cpp:1465
QDBusConnection sessionBus()
QString join(const QString &separator) const
QString tabTitleFormat(TabTitleContext context) const
Returns the format used by this session for tab titles.
Definition: Session.cpp:595
QString & remove(int position, int n)
void setWindowSize(int columns, int lines)
Sets the size of the window (in columns and lines of characters) used by this teletype.
Definition: Pty.cpp:91
QString currentPath()
void setProgram(const QString &program)
Sets the program to be executed when run() is called.
Definition: Session.cpp:267
virtual void sendText(const QString &text)=0
Interprets a sequence of characters and sends the result to the terminal.
QStringList arguments() const
Returns the arguments passed to the shell process when run() is called.
Definition: Session.cpp:1082
virtual char eraseChar() const
Returns the special character used for erasing character.
Definition: Emulation.cpp:333
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
void setDarkBackground(bool darkBackground)
Sets whether the session has a dark background or not.
Definition: Session.cpp:235
QList< TerminalDisplay * > views() const
Returns the views connected to this session.
Definition: Session.cpp:303
QString baseService() const
QString currentWorkingDirectory()
Returns the current directory of the foreground process in the session.
Definition: Session.cpp:282
void setCodec(const QTextCodec *)
Sets the codec used to decode incoming characters.
Definition: Emulation.cpp:149
void setHistoryType(const HistoryType &type)
Sets the type of history store used by this session.
Definition: Session.cpp:1067
static ProcessInfo * newInstance(int pid, bool readEnvironment=false)
Constructs a new instance of a suitable ProcessInfo sub-class for the current platform which provides...
Definition: ProcessInfo.cpp:1165
Q_SCRIPTABLE QByteArray codec()
Returns the codec used to decode incoming characters in this terminal emulation.
Definition: Session.cpp:262
QString userName() const
Returns the user name which the user initially logged into on the remote computer.
Definition: ProcessInfo.cpp:1119
bool flowControlWarningEnabled() const
Returns true if the flow control warning box is enabled.
Definition: TerminalDisplay.h:506
The Pty class is used to start the terminal process, send data to it, receive data from it and manipu...
Definition: Pty.h:52
bool programBracketedPasteMode() const
Definition: Emulation.cpp:70
void clear()
void setUsesMouse(bool usesMouse)
Sets whether the program whose output is being displayed in the view is interested in mouse events...
Definition: TerminalDisplay.cpp:2676
void primaryScreenInUse(bool use)
Emitted when the active screen is switched, to indicate whether the primary screen is in use...
void resizeRequest(const QSize &size)
Emitted when the terminal process requests a change in the size of the terminal window.
void bellRequest(const QString &message)
Emitted when a bell event occurs in the session.
Q_SCRIPTABLE void setMonitorSilence(bool)
Enables monitoring for silence in the session.
Definition: Session.cpp:1115
The emulation is currently receiving data from its terminal input.
Definition: Emulation.h:62
void setTabTitleFormat(TabTitleContext context, const QString &format)
Sets the format used by this session for tab titles.
Definition: Session.cpp:588
const char * name() const
void profileChangeCommandReceived(const QString &text)
Emitted when a profile change command is received from the terminal.
const HistoryType & historyType() const
Returns the type of history store used by this session.
Definition: Session.cpp:1072
int indexOf(char ch, int from) const
bool isRunning() const
Returns true if the session is currently running.
Definition: Session.cpp:240
QWidget * activeWindow()
virtual void sendMouseEvent(int buttons, int column, int line, int eventType)
Converts information about a mouse event into an xterm-compatible escape sequence and emits the chara...
Definition: Emulation.cpp:216
QString number(int n, int base)
QString fromLocal8Bit(const char *str, int size)
int masterMode() const
Returns a bitwise OR of the active MasterMode flags for this group.
Definition: Session.cpp:1457
void setUserHomeDir()
Forces the user home directory to be calculated.
Definition: ProcessInfo.cpp:280
QString name(bool *ok) const
Returns the name of the current process.
Definition: ProcessInfo.cpp:233
int lines() const
Returns the number of lines of text which can be displayed in the widget.
Definition: TerminalDisplay.h:268
bool isRemote()
Returns true if the session currently contains a connection to a remote computer. ...
Definition: Session.cpp:981
void changeTabTextColorRequest(int)
Requests that the color the text for any tabs associated with this session should be changed;...
Emulation * emulation() const
Returns the terminal emulation instance being used to encode / decode characters to / from the proces...
Definition: Session.cpp:874
Lightweight class which provides additional information about SSH processes.
Definition: ProcessInfo.h:406
void flowControlEnabledChanged(bool enabled)
Emitted when the flow control state changes.
bool isEmpty() const
Takes a snapshot of the state of a process and provides access to information such as the process nam...
Definition: ProcessInfo.h:74
bool isEmpty() const
void setTitle(TitleRole role, const QString &title)
Sets the session's title for the specified role to title.
Definition: Session.cpp:909
void setMasterStatus(Session *session, bool master)
Sets whether a particular session is a master within the group.
Definition: Session.cpp:1495
const char * constData() const
QString keyBindings() const
Returns the name of the emulation's current key bindings.
Definition: Emulation.cpp:179
Definition: Session.h:356
QString iconText() const
Returns the text of the icon associated with this session.
Definition: Session.cpp:1062
The terminal program has triggered a bell event to get the user's attention.
Definition: Emulation.h:57
QString format(const QString &text) const
Parses an input string, looking for markers beginning with a '' character and returns a string with t...
Definition: ProcessInfo.cpp:120
void setIconName(const QString &iconName)
Sets the name of the icon associated with this session.
Definition: Session.cpp:1044
bool programUsesMouse() const
Returns true if the active terminal program wants mouse input events.
Definition: Emulation.cpp:60
void setInitialWorkingDirectory(const QString &dir)
Sets the initial working directory for the session when it is run This has no effect once the session...
Definition: Session.cpp:277
int count(char ch) const
void truncate(int pos)
Tab title format used session currently contains a connection to a remote computer (via SSH) ...
Definition: Session.h:166
ScreenWindow * createWindow()
Creates a new window onto the output from this emulation.
Definition: Emulation.cpp:80
QString host() const
Returns the host which the user has connected to.
Definition: ProcessInfo.cpp:1123
WId winId() const
void stateChanged(int state)
Emitted when the activity state of this session changes.
QByteArray mid(int pos, int len) const
int columns() const
Returns the number of characters of text which can be displayed on each line in the widget...
Definition: TerminalDisplay.h:278
void setMasterMode(int mode)
Specifies which activity in the group's master sessions is propagated to all sessions in the group...
Definition: Session.cpp:1487
void setKeyBindings(const QString &name)
Sets the key bindings used by this session.
Definition: Session.cpp:904
QByteArray toLocal8Bit() const
Definition: Session.h:358
Q_SCRIPTABLE QStringList environment() const
Returns the environment of this session as a list of strings like VARIABLE=VALUE. ...
Definition: Session.cpp:884
QString validCurrentDir() const
Returns the current working directory of the process (or its parent)
Definition: ProcessInfo.cpp:101
void stop()
void setInitialWorkingDirectory(const QString &dir)
Sets the initial working directory.
Definition: Pty.cpp:182
Definition: History.h:359
bool isForegroundProcessActive()
Returns true if the user has started a program in the session.
Definition: Session.cpp:1405
Q_SCRIPTABLE void setHistorySize(int lines)
Sets the history capacity of this session.
Definition: Session.cpp:1367
bool isValid() const
Returns true if the process state was read successfully.
Definition: ProcessInfo.cpp:207
~SessionGroup()
Destroys the session group and removes all connections between master and slave sessions.
Definition: Session.cpp:1454
Definition: History.h:319
QString title(TitleRole role) const
Returns the session's title for the specified role.
Definition: Session.cpp:921
Provides an xterm compatible terminal emulation based on the DEC VT102 terminal.
Definition: Vt102Emulation.h:76
QByteArray left(int len) const
bool flowControlEnabled() const
Queries the terminal state and returns true if Xon/Xoff flow control is enabled.
Definition: Pty.cpp:122
Q_SCRIPTABLE bool isMonitorActivity() const
Returns true if monitoring for activity is enabled.
Definition: Session.cpp:1092
void changeBackgroundColorRequest(const QColor &)
Requests that the background color of views on this session should be changed.
QDateTime currentDateTime()
void setIconText(const QString &iconText)
Sets the text of the icon associated with this session.
Definition: Session.cpp:1052
QString format(const QString &input) const
Operates in the same way as ProcessInfo::format(), except that the set of markers understood is diffe...
Definition: ProcessInfo.cpp:1135
void setScreenWindow(ScreenWindow *window)
Sets the terminal screen section which is displayed in this widget.
Definition: TerminalDisplay.cpp:107
QWidget * parentWidget() const
void setFlowControlEnabled(bool on)
Enables or disables Xon/Xoff flow control.
Definition: Pty.cpp:105
QTextCodec * codecForName(const QByteArray &name)
void setArguments(const QStringList &arguments)
Sets the command line arguments which the session's program will be passed when run() is called...
Definition: Session.cpp:272
int height() const
Q_SCRIPTABLE bool isMonitorSilence() const
Returns true if monitoring for inactivity (silence) in the session is enabled.
Definition: Session.cpp:1096
void setAutoClose(bool close)
Specifies whether to close the session automatically when the terminal process terminates.
Definition: Session.cpp:1143
Definition: Session.h:354
void receiveData(const char *buffer, int len)
Processes an incoming stream of characters.
Definition: Emulation.cpp:225
void changeForegroundColorRequest(const QColor &)
Requests that the text color of views on this session should be changed to color. ...
QString section(QChar sep, int start, int end, QFlags< QString::SectionFlag > flags) const
void setKeyBindings(const QString &name)
Sets the key bindings used to key events ( received through sendKeyEvent() ) into character streams t...
Definition: Emulation.cpp:171
void start(int msec)
const QTextCodec * codec() const
Returns the codec used to decode incoming characters.
Definition: Emulation.h:169
Q_SCRIPTABLE void setFlowControlEnabled(bool enabled)
Sets whether flow control is enabled for this terminal session.
Definition: Session.cpp:1153
Definition: Session.h:359
void addEnvironmentEntry(const QString &entry)
Adds one entry for the environment of this session entry should be like VARIABLE=VALUE.
Definition: Session.cpp:894
void selectionChanged(const QString &text)
Emitted when the text selection is changed.
QString foregroundProcessName()
Returns the name of the current foreground process.
Definition: Session.cpp:1411
void setSize(const QSize &size)
Emits a request to resize the session to accommodate the specified window size.
Definition: Session.cpp:1290
TabTitleContext
This enum describes the contexts for which separate tab title formats may be specified.
Definition: Session.h:159
void zmodemDetected()
Emitted when the request for data transmission through ZModem protocol is detected.
const HistoryType & history() const
Returns the history store used by this emulation.
Definition: Emulation.cpp:144
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Q_SCRIPTABLE bool flowControlEnabled() const
Returns whether flow control is enabled for this terminal session.
Definition: Session.cpp:1162
void addProgressText(const QString &)
Adds a line of text to the progress window.
Definition: ZModemDialog.cpp:50
Definition: Session.h:360
A widget which displays output from a terminal emulation and sends input keypresses and mouse activit...
Definition: TerminalDisplay.h:63
Q_SCRIPTABLE void sendText(const QString &text) const
Sends text to the current foreground terminal program.
Definition: Session.cpp:819
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
void setUserTitle(int what, const QString &caption)
Changes the session title or other customizable aspects of the terminal emulation display...
Definition: Session.cpp:518
QString toString() const
Q_SCRIPTABLE void runCommand(const QString &command) const
Sends command to the current foreground terminal program.
Definition: Session.cpp:824
QString iconName() const
Returns the name of the icon associated with this session.
Definition: Session.cpp:1057
Q_SCRIPTABLE void setMonitorSilenceSeconds(int seconds)
See setMonitorSilence()
Definition: Session.cpp:1130
Definition: Session.h:357
void destroyed(QObject *obj)
QString program() const
Returns the program name of the shell process started when run() is called.
Definition: Session.cpp:1087
bool isValid() const
QString port() const
Returns the port on host which the user has connected to.
Definition: ProcessInfo.cpp:1127
void removeView(TerminalDisplay *widget)
Removes a view from this session.
Definition: Session.cpp:355
void setWriteable(bool writeable)
Control whether the pty device is writeable by group members.
Definition: Pty.cpp:261
void setSingleShot(bool singleShot)
bool isNull() const
QString getDynamicTitle()
Returns a title generated from tab format and process information.
Definition: Session.cpp:989
void setUtf8Mode(bool on)
Put the pty into UTF-8 mode on systems which support it.
Definition: Pty.cpp:135
QByteArray toUtf8() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.