Konsole
Session.cpp
Go to the documentation of this file.
124 QDBusConnection::sessionBus().registerObject(QLatin1String("/Sessions/") + QString::number(_sessionId), this);
400 static const QByteArray warningText = i18nc("@info:shell Alert the user with red color text", "Warning: ").toLocal8Bit();
462 terminalWarning(i18n("Could not find '%1', starting '%2' instead. Please check your profile settings.", _program, exec));
503 terminalWarning(i18n("Could not start program '%1' with arguments '%2'.", exec, arguments.join(" ")));
601 //FIXME: The idea here is that the notification popup will appear to tell the user than output from
607 //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:125
void startZModem(const QString &rz, const QString &dir, const QStringList &list)
Definition: Session.cpp:1176
Q_SCRIPTABLE void setMonitorActivity(bool)
Enables monitoring for activity in the session.
Definition: Session.cpp:1094
Definition: Session.h:344
Represents a terminal session consisting of a pseudo-teletype and a terminal emulation.
Definition: Session.h:67
void restoreSession(KConfigGroup &group)
Definition: Session.cpp:1427
Q_SCRIPTABLE int foregroundProcessId()
Returns the process id of the terminal's foreground process.
Definition: Session.cpp:1386
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:883
int foregroundProcessGroup() const
Returns the process id of the teletype's current foreground process.
Definition: Pty.cpp:276
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:1131
virtual void setImageSize(int lines, int columns)
Change the size of the emulation's image.
Definition: Emulation.cpp:326
Q_SCRIPTABLE QString shellSessionId() const
Returns the "friendly" version of the QUuid of this session.
Definition: Session.cpp:414
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:823
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:1371
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:939
void setEraseChar(char eraseChar)
Sets the special character for erasing previous not-yet-erased character.
Definition: Pty.cpp:156
Definition: History.h:348
Definition: ZModemDialog.h:29
void setPreferredSize(const QSize &size)
Definition: Session.cpp:1296
QSize imageSize() const
Returns the size of the screen image which the emulation produces.
Definition: Emulation.cpp:366
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:2861
QList< Session * > sessions() const
Returns the list of sessions currently in the group.
Definition: Session.cpp:1454
void refresh()
Attempts to get the shell program to redraw the current display area.
Definition: Session.cpp:713
The title of the session which is displayed in tabs etc.
Definition: Session.h:244
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:1458
QString tabTitleFormat(TabTitleContext context) const
Returns the format used by this session for tab titles.
Definition: Session.cpp:589
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
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:1075
virtual char eraseChar() const
Returns the special character used for erasing character.
Definition: Emulation.cpp:321
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 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:137
void setHistoryType(const HistoryType &type)
Sets the type of history store used by this session.
Definition: Session.cpp:1060
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:504
The Pty class is used to start the terminal process, send data to it, receive data from it and manipu...
Definition: Pty.h:52
void setUsesMouse(bool usesMouse)
Sets whether the program whose output is being displayed in the view is interested in mouse events...
Definition: TerminalDisplay.cpp:2666
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:1108
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:582
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:1065
bool isRunning() const
Returns true if the session is currently running.
Definition: Session.cpp:240
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:204
int masterMode() const
Returns a bitwise OR of the active MasterMode flags for this group.
Definition: Session.cpp:1450
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:975
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:868
Lightweight class which provides additional information about SSH processes.
Definition: ProcessInfo.h:406
void flowControlEnabledChanged(bool enabled)
Emitted when the flow control state changes.
Takes a snapshot of the state of a process and provides access to information such as the process nam...
Definition: ProcessInfo.h:74
void setTitle(TitleRole role, const QString &title)
Sets the session's title for the specified role to title.
Definition: Session.cpp:903
void setMasterStatus(Session *session, bool master)
Sets whether a particular session is a master within the group.
Definition: Session.cpp:1488
QString keyBindings() const
Returns the name of the emulation's current key bindings.
Definition: Emulation.cpp:167
Definition: Session.h:345
QString iconText() const
Returns the text of the icon associated with this session.
Definition: Session.cpp:1055
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:1037
bool programUsesMouse() const
Returns true if the active terminal program wants mouse input events.
Definition: Emulation.cpp:57
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
Tab title format used session currently contains a connection to a remote computer (via SSH) ...
Definition: Session.h:155
ScreenWindow * createWindow()
Creates a new window onto the output from this emulation.
Definition: Emulation.cpp:67
QString host() const
Returns the host which the user has connected to.
Definition: ProcessInfo.cpp:1123
void stateChanged(int state)
Emitted when the activity state of this session changes.
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:1480
void setKeyBindings(const QString &name)
Sets the key bindings used by this session.
Definition: Session.cpp:898
Definition: Session.h:347
Q_SCRIPTABLE QStringList environment() const
Returns the environment of this session as a list of strings like VARIABLE=VALUE. ...
Definition: Session.cpp:878
QString validCurrentDir() const
Returns the current working directory of the process (or its parent)
Definition: ProcessInfo.cpp:101
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:1398
Q_SCRIPTABLE void setHistorySize(int lines)
Sets the history capacity of this session.
Definition: Session.cpp:1360
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:1447
Definition: History.h:319
QString title(TitleRole role) const
Returns the session's title for the specified role.
Definition: Session.cpp:915
Provides an xterm compatible terminal emulation based on the DEC VT102 terminal.
Definition: Vt102Emulation.h:75
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:1085
void changeBackgroundColorRequest(const QColor &)
Requests that the background color of views on this session should be changed.
void setIconText(const QString &iconText)
Sets the text of the icon associated with this session.
Definition: Session.cpp:1045
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
void setFlowControlEnabled(bool on)
Enables or disables Xon/Xoff flow control.
Definition: Pty.cpp:105
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
Q_SCRIPTABLE bool isMonitorSilence() const
Returns true if monitoring for inactivity (silence) in the session is enabled.
Definition: Session.cpp:1089
void setAutoClose(bool close)
Specifies whether to close the session automatically when the terminal process terminates.
Definition: Session.cpp:1136
Definition: Session.h:343
void receiveData(const char *buffer, int len)
Processes an incoming stream of characters.
Definition: Emulation.cpp:213
void changeForegroundColorRequest(const QColor &)
Requests that the text color of views on this session should be changed to color. ...
void setKeyBindings(const QString &name)
Sets the key bindings used to key events ( received through sendKeyEvent() ) into character streams t...
Definition: Emulation.cpp:159
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:1146
Definition: Session.h:348
void addEnvironmentEntry(const QString &entry)
Adds one entry for the environment of this session entry should be like VARIABLE=VALUE.
Definition: Session.cpp:888
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:1404
void setSize(const QSize &size)
Emits a request to resize the session to accommodate the specified window size.
Definition: Session.cpp:1283
TabTitleContext
This enum describes the contexts for which separate tab title formats may be specified.
Definition: Session.h:148
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:132
Q_SCRIPTABLE bool flowControlEnabled() const
Returns whether flow control is enabled for this terminal session.
Definition: Session.cpp:1155
void addProgressText(const QString &)
Adds a line of text to the progress window.
Definition: ZModemDialog.cpp:50
Definition: Session.h:349
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:813
void setUserTitle(int what, const QString &caption)
Changes the session title or other customizable aspects of the terminal emulation display...
Definition: Session.cpp:512
Q_SCRIPTABLE void runCommand(const QString &command) const
Sends command to the current foreground terminal program.
Definition: Session.cpp:818
QString iconName() const
Returns the name of the icon associated with this session.
Definition: Session.cpp:1050
Q_SCRIPTABLE void setMonitorSilenceSeconds(int seconds)
See setMonitorSilence()
Definition: Session.cpp:1123
Definition: Session.h:346
QString program() const
Returns the program name of the shell process started when run() is called.
Definition: Session.cpp:1080
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:350
void setWriteable(bool writeable)
Control whether the pty device is writeable by group members.
Definition: Pty.cpp:261
QString getDynamicTitle()
Returns a title generated from tab format and process information.
Definition: Session.cpp:983
void setUtf8Mode(bool on)
Put the pty into UTF-8 mode on systems which support it.
Definition: Pty.cpp:135
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.