Konsole
Konsole::Session Class Reference
#include <Session.h>

Detailed Description
Represents a terminal session consisting of a pseudo-teletype and a terminal emulation.The pseudo-teletype (or PTY) handles I/O between the terminal process and Konsole. The terminal emulation ( Emulation and subclasses ) processes the output stream from the PTY and produces a character image which is then shown on views connected to the session.
Each Session can be connected to one or more views by using the addView() method. The attached views can then display output from the program running in the terminal or send input to the program in the terminal in the form of keypresses and mouse activity.
Definition at line 59 of file Session.h.
Member Enumeration Documentation
Possible values of the what
parameter for setUserTitle() See "Operating System Controls" section on http://rtfm.etla.org/xterm/ctlseq.html.
Constructor & Destructor Documentation
Session::Session | ( | QObject * | parent = 0 |
) | [explicit] |
Constructs a new session.
To start the terminal process, call the run() method, after specifying the program and arguments using setProgram() and setArguments()
If no program or arguments are specified explicitly, the Session falls back to using the program specified in the SHELL environment variable.
Definition at line 65 of file Session.cpp.
Session::~Session | ( | ) |
Definition at line 649 of file Session.cpp.
Member Function Documentation
void Session::addView | ( | TerminalDisplay * | widget | ) |
Adds a new view for this session.
The viewing widget will display the output from the terminal and input from the viewing widget (key presses, mouse activity etc.) will be sent to the terminal.
Views can be removed using removeView(). The session is automatically closed when the last view is removed.
Definition at line 207 of file Session.cpp.
QStringList Session::arguments | ( | ) | const |
Returns the arguments passed to the shell process when run() is called.
Definition at line 777 of file Session.cpp.
void Konsole::Session::bellRequest | ( | const QString & | message | ) | [signal] |
Emitted when a bell event occurs in the session.
void Session::cancelZModem | ( | ) |
Definition at line 854 of file Session.cpp.
void Konsole::Session::changeBackgroundColorRequest | ( | const QColor & | ) | [signal] |
Requests that the background color of views on this session should be changed.
void Konsole::Session::changeForegroundColorRequest | ( | const QColor & | ) | [signal] |
Requests that the text color of views on this session should be changed to color
.
void Konsole::Session::changeTabTextColorRequest | ( | int | ) | [signal] |
Requests that the color the text for any tabs associated with this session should be changed;.
TODO: Document what the parameter does
void Session::clearHistory | ( | ) |
void Session::close | ( | ) | [slot] |
Closes the terminal session.
This sends a hangup signal (SIGHUP) to the terminal process and causes the done(Session*) signal to be emitted.
Definition at line 632 of file Session.cpp.
Emulation * Session::emulation | ( | ) | const |
Returns the terminal emulation instance being used to encode / decode characters to / from the process.
Definition at line 685 of file Session.cpp.
QStringList Session::environment | ( | ) | const |
Returns the environment of this session as a list of strings like VARIABLE=VALUE.
Definition at line 695 of file Session.cpp.
void Konsole::Session::finished | ( | ) | [signal] |
Emitted when the terminal process exits.
bool Session::flowControlEnabled | ( | ) | const |
Returns whether flow control is enabled for this terminal session.
Definition at line 838 of file Session.cpp.
void Konsole::Session::flowControlEnabledChanged | ( | bool | enabled | ) | [signal] |
Emitted when the flow control state changes.
- Parameters:
-
enabled True if flow control is enabled or false otherwise.
int Session::foregroundProcessId | ( | ) | const |
Returns the process id of the terminal's foreground process.
This is initially the same as processId() but can change as the user starts other programs inside the terminal.
Definition at line 973 of file Session.cpp.
bool Session::hasDarkBackground | ( | ) | const |
Returns true if the session has a dark background.
Definition at line 175 of file Session.cpp.
const HistoryType & Session::historyType | ( | ) | const |
QString Session::iconName | ( | ) | const |
Returns the name of the icon associated with this session.
Definition at line 752 of file Session.cpp.
QString Session::iconText | ( | ) | const |
Returns the text of the icon associated with this session.
Definition at line 757 of file Session.cpp.
QString Konsole::Session::initialWorkingDirectory | ( | ) | [inline] |
bool Session::isMonitorActivity | ( | ) | const |
bool Session::isMonitorSilence | ( | ) | const |
Returns true if monitoring for inactivity (silence) in the session is enabled.
Definition at line 790 of file Session.cpp.
bool Session::isRunning | ( | ) | const |
Returns true if the session is currently running.
This will be true after run() has been called successfully.
Definition at line 179 of file Session.cpp.
QString Konsole::Session::keyBindings | ( | ) | const |
Returns the name of the key bindings used by this session.
QString Konsole::Session::nameTitle | ( | ) | const [inline] |
void Session::openTeletype | ( | int | masterFd | ) |
Connect to an existing terminal.
When a new Session() is constructed it automatically searches for and opens a new teletype. If you want to use an existing teletype (given its file descriptor) call this after constructing the session.
Calling openTeletype() while a session is running has no effect.
- Parameters:
-
masterFd The file descriptor of the pseudo-teletype master (See KPtyProcess::KPtyProcess())
Definition at line 114 of file Session.cpp.
void Konsole::Session::openUrlRequest | ( | const QString & | url | ) | [signal] |
TODO: Document me.
int Konsole::Session::processId | ( | ) | const |
Returns the process id of the terminal process.
This is the id used by the system API to refer to the process.
void Konsole::Session::profileChangeCommandReceived | ( | const QString & | text | ) | [signal] |
Emitted when a profile change command is received from the terminal.
- Parameters:
-
text The text of the command. This is a string of the form "PropertyName=Value;PropertyName=Value ..."
QString Session::program | ( | ) | const |
Returns the program name of the shell process started when run() is called.
Definition at line 782 of file Session.cpp.
void Konsole::Session::receivedData | ( | const QString & | text | ) | [signal] |
Emitted when output is received from the terminal process.
void Session::refresh | ( | ) |
Attempts to get the shell program to redraw the current display area.
This can be used after clearing the screen, for example, to get the shell to redraw the prompt line.
Definition at line 598 of file Session.cpp.
void Session::removeView | ( | TerminalDisplay * | widget | ) |
Removes a view from this session.
When the last view is removed, the session will be closed automatically.
widget
will no longer display output from or send input to the terminal
Definition at line 250 of file Session.cpp.
void Konsole::Session::resizeRequest | ( | const QSize & | size | ) | [signal] |
Emitted when the terminal process requests a change in the size of the terminal window.
- Parameters:
-
size The requested window size in terms of lines and columns.
void Session::run | ( | ) | [slot] |
Starts the terminal session.
This creates the terminal process and connects the teletype to it.
Definition at line 320 of file Session.cpp.
void Session::sendText | ( | const QString & | text | ) | const |
int Session::sessionId | ( | ) | const |
void Session::setAddToUtmp | ( | bool | set | ) |
Specifies whether a utmp entry should be created for the pty used by this session.
If true, KPty::login() is called when the session is started.
Definition at line 824 of file Session.cpp.
void Session::setArguments | ( | const QStringList & | arguments | ) |
Sets the command line arguments which the session's program will be passed when run() is called.
Definition at line 197 of file Session.cpp.
void Konsole::Session::setAutoClose | ( | bool | b | ) | [inline] |
void Session::setCodec | ( | QTextCodec * | codec | ) |
Sets the text codec used by this session's terminal emulation.
Definition at line 184 of file Session.cpp.
void Session::setDarkBackground | ( | bool | darkBackground | ) |
Sets whether the session has a dark background or not.
The session uses this information to set the COLORFGBG variable in the process's environment, which allows the programs running in the terminal to determine whether the background is light or dark and use appropriate colors by default.
This has no effect once the session is running.
Definition at line 171 of file Session.cpp.
void Session::setEnvironment | ( | const QStringList & | environment | ) |
Sets the environment for this session.
environment
should be a list of strings like VARIABLE=VALUE
Definition at line 700 of file Session.cpp.
void Session::setFlowControlEnabled | ( | bool | enabled | ) |
Sets whether flow control is enabled for this terminal session.
Definition at line 829 of file Session.cpp.
void Session::setHistoryType | ( | const HistoryType & | type | ) |
Sets the type of history store used by this session.
Lines of output produced by the terminal are added to the history store. The type of history store used affects the number of lines which can be remembered before they are lost and the storage (in memory, on-disk etc.) used.
Definition at line 762 of file Session.cpp.
void Session::setIconName | ( | const QString & | iconName | ) |
void Session::setIconText | ( | const QString & | iconText | ) |
void Session::setInitialWorkingDirectory | ( | const QString & | dir | ) |
Sets the initial working directory for the session when it is run This has no effect once the session has been started.
Definition at line 193 of file Session.cpp.
void Session::setKeyBindings | ( | const QString & | id | ) |
Sets the key bindings used by this session.
The bindings specify how input key sequences are translated into the character stream which is sent to the terminal.
- Parameters:
-
id The name of the key bindings to use. The names of available key bindings can be determined using the KeyboardTranslatorManager class.
Definition at line 710 of file Session.cpp.
void Session::setMonitorActivity | ( | bool | _monitor | ) |
Enables monitoring for activity in the session.
This will cause notifySessionState() to be emitted with the NOTIFYACTIVITY state flag when output is received from the terminal.
Definition at line 792 of file Session.cpp.
void Session::setMonitorSilence | ( | bool | _monitor | ) |
Enables monitoring for silence in the session.
This will cause notifySessionState() to be emitted with the NOTIFYSILENCE state flag when output is not received from the terminal for a certain period of time, specified with setMonitorSilenceSeconds()
Definition at line 800 of file Session.cpp.
void Session::setMonitorSilenceSeconds | ( | int | seconds | ) |
void Session::setProgram | ( | const QString & | program | ) |
void Session::setSize | ( | const QSize & | size | ) |
Emits a request to resize the session to accommodate the specified window size.
- Parameters:
-
size The size in lines and columns to request.
Definition at line 966 of file Session.cpp.
void Session::setTabTitleFormat | ( | TabTitleContext | context, | |
const QString & | format | |||
) |
Sets the format used by this session for tab titles.
- Parameters:
-
context The context whoose format should be set. format The tab title format. This may be a mixture of plain text and dynamic elements denoted by a '' character followed by a letter. (eg. d for directory). The dynamic elements available depend on the context
Definition at line 466 of file Session.cpp.
Sets the session's title for the specified role
to title
.
Definition at line 715 of file Session.cpp.
void Session::setUserTitle | ( | int | what, | |
const QString & | caption | |||
) | [slot] |
Changes the session title or other customizable aspects of the terminal emulation display.
For a list of what may be changed see the Emulation::titleChanged() signal.
- Parameters:
-
what The feature being changed. Value is one of UserTitleChange caption The text part of the terminal command
Definition at line 393 of file Session.cpp.
QSize Konsole::Session::size | ( | ) |
Returns the terminal session's window size in lines and columns.
void Konsole::Session::started | ( | ) | [signal] |
Emitted when the terminal process starts.
void Session::startZModem | ( | const QString & | rz, | |
const QString & | dir, | |||
const QStringList & | list | |||
) |
Definition at line 860 of file Session.cpp.
void Konsole::Session::stateChanged | ( | int | state | ) | [signal] |
Emitted when the activity state of this session changes.
- Parameters:
-
state The new state of the session. This may be one of NOTIFYNORMAL, NOTIFYSILENCE or NOTIFYACTIVITY
QString Session::tabTitleFormat | ( | TabTitleContext | context | ) | const |
void Konsole::Session::titleChanged | ( | ) | [signal] |
Emitted when the session's title has changed.
QString Session::userTitle | ( | ) | const |
Return the session title set by the user (ie.
the program running in the terminal), or an empty string if the user has not set a custom title
Definition at line 462 of file Session.cpp.
QList< TerminalDisplay * > Session::views | ( | ) | const |
void Konsole::Session::zmodemDetected | ( | ) | [signal] |
TODO: Document me.
Property Documentation
The documentation for this class was generated from the following files: