KSession
#include <ksession.h>

Properties | |
| QString | currentDir |
| QString | foregroundProcessName |
| bool | hasActiveProcess |
| QString | history |
| int | historySize |
| QString | initialWorkingDirectory |
| QString | kbScheme |
| bool | monitorSilence |
| QString | shellProgram |
| QStringList | shellProgramArgs |
| QString | title |
Properties inherited from QObject | |
| objectName | |
Signals | |
| void | argsChanged () |
| void | bellRequest (QString message) |
| void | changedKeyBindings (QString kb) |
| void | copyAvailable (bool) |
| void | currentDirChanged () |
| void | finished () |
| void | foregroundProcessNameChanged () |
| void | hasActiveProcessChanged () |
| void | historySizeChanged () |
| void | initialWorkingDirectoryChanged () |
| void | matchFound (int startColumn, int startLine, int endColumn, int endLine) |
| void | monitorSilenceChanged () |
| void | noMatchFound () |
| void | processHasSilent (bool value) |
| void | shellProgramChanged () |
| void | started () |
| void | termGetFocus () |
| void | termKeyPressed (QKeyEvent *, bool) |
| void | termLostFocus () |
| void | titleChanged () |
Public Slots | |
| QStringList | args () const |
| void | changeDir (const QString &dir) |
| void | clearScreen () |
| int | getForegroundProcessError () const |
| int | getShellPID () |
| void | search (const QString ®exp, int startLine=0, int startColumn=0, bool forwards=true) |
| void | selectionChanged (bool textSelected) |
| void | sendKey (int rep, int key, int mod) const |
| bool | sendSignal (int signal) |
| void | sendText (QString text) |
| void | setArgs (const QStringList &args) |
| void | setKeyBindings (const QString &kb) |
| void | setShellProgram (const QString &progname) |
| void | setTitle (QString name) |
| QString | shellProgram () const |
| void | startShellProgram () |
Public Member Functions | |
| KSession (QObject *parent=nullptr) | |
| void | addView (TerminalDisplay *display) |
| QString | currentDir () |
| bool | flowControlEnabled (void) |
| QString | foregroundProcessName () |
| QString | getHistory () const |
| QString | getInitialWorkingDirectory () |
| QString | getKeyBindings () |
| int | getRandomSeed () |
| QString | getTitle () |
| bool | hasActiveProcess () const |
| int | historySize () const |
| QString | keyBindings () |
| bool | monitorSilence () const |
| void | removeView (TerminalDisplay *display) |
| void | setEnvironment (const QStringList &environment) |
| void | setFlowControlEnabled (bool enabled) |
| void | setHistorySize (int lines) |
| void | setInitialWorkingDirectory (const QString &dir) |
| void | setMonitorSilence (bool value) |
| void | setTextCodec (QTextCodec *codec) |
Public Member Functions inherited from QObject | |
| QObject (QObject *parent) | |
| QBindable< QString > | bindableObjectName () |
| bool | blockSignals (bool block) |
| const QObjectList & | children () const const |
| QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
| void | deleteLater () |
| void | destroyed (QObject *obj) |
| bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
| bool | disconnect (const QObject *receiver, const char *method) const const |
| void | dumpObjectInfo () const const |
| void | dumpObjectTree () const const |
| QList< QByteArray > | dynamicPropertyNames () const const |
| virtual bool | event (QEvent *e) |
| virtual bool | eventFilter (QObject *watched, QEvent *event) |
| T | findChild (const QString &name, Qt::FindChildOptions options) const const |
| QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
| QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
| QList< T > | findChildren (Qt::FindChildOptions options) const const |
| bool | inherits (const char *className) const const |
| void | installEventFilter (QObject *filterObj) |
| bool | isQuickItemType () const const |
| bool | isWidgetType () const const |
| bool | isWindowType () const const |
| void | killTimer (int id) |
| virtual const QMetaObject * | metaObject () const const |
| void | moveToThread (QThread *targetThread) |
| QString | objectName () const const |
| void | objectNameChanged (const QString &objectName) |
| QObject * | parent () const const |
| QVariant | property (const char *name) const const |
| Q_CLASSINFO (Name, Value) | |
| Q_EMIT Q_EMIT | |
| Q_ENUM (...) | |
| Q_ENUM_NS (...) | |
| Q_ENUMS (...) | |
| Q_FLAG (...) | |
| Q_FLAG_NS (...) | |
| Q_FLAGS (...) | |
| Q_GADGET Q_GADGET | |
| Q_GADGET_EXPORT (EXPORT_MACRO) | |
| Q_INTERFACES (...) | |
| Q_INVOKABLE Q_INVOKABLE | |
| Q_MOC_INCLUDE Q_MOC_INCLUDE | |
| Q_NAMESPACE Q_NAMESPACE | |
| Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
| Q_OBJECT Q_OBJECT | |
| Q_PROPERTY (...) | |
| Q_REVISION Q_REVISION | |
| Q_SET_OBJECT_NAME (Object) | |
| Q_SIGNAL Q_SIGNAL | |
| Q_SIGNALS Q_SIGNALS | |
| Q_SLOT Q_SLOT | |
| Q_SLOTS Q_SLOTS | |
| T | qobject_cast (const QObject *object) |
| T | qobject_cast (QObject *object) |
| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
| void | removeEventFilter (QObject *obj) |
| void | setObjectName (const QString &name) |
| void | setObjectName (QAnyStringView name) |
| void | setParent (QObject *parent) |
| bool | setProperty (const char *name, const QVariant &value) |
| bool | setProperty (const char *name, QVariant &&value) |
| bool | signalsBlocked () const const |
| int | startTimer (int interval, Qt::TimerType timerType) |
| int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
| QThread * | thread () const const |
Static Public Member Functions | |
| static QStringList | availableKeyBindings () |
Static Public Member Functions inherited from QObject | |
| QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
| QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
| QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
| QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
| QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
| bool | disconnect (const QMetaObject::Connection &connection) |
| bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
| bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
| bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
| QString | tr (const char *sourceText, const char *disambiguation, int n) |
Protected Slots | |
| void | sessionFinished () |
Additional Inherited Members | |
Public Attributes inherited from QObject | |
| typedef | QObjectList |
Protected Member Functions inherited from QObject | |
| virtual void | childEvent (QChildEvent *event) |
| virtual void | connectNotify (const QMetaMethod &signal) |
| virtual void | customEvent (QEvent *event) |
| virtual void | disconnectNotify (const QMetaMethod &signal) |
| bool | isSignalConnected (const QMetaMethod &signal) const const |
| int | receivers (const char *signal) const const |
| QObject * | sender () const const |
| int | senderSignalIndex () const const |
| virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
The KSession class Creates and controls the terminal session.
This class is exposed to the QML engine as Session.
- Note
- This class is not part of any public API and it is only part of the Terminal QML control implementation
Definition at line 37 of file ksession.h.
Property Documentation
◆ currentDir
|
read |
The current directory of the session.
Definition at line 84 of file ksession.h.
◆ foregroundProcessName
|
read |
The name of the current process running.
Definition at line 79 of file ksession.h.
◆ hasActiveProcess
|
read |
Whether the session has an active process running.
Definition at line 74 of file ksession.h.
◆ history
|
read |
The commands history.
Definition at line 69 of file ksession.h.
◆ historySize
|
readwrite |
Allows to set the amount of lines to store in the history.
Definition at line 89 of file ksession.h.
◆ initialWorkingDirectory
|
readwrite |
Set the initial working directory from a local path.
Definition at line 49 of file ksession.h.
◆ kbScheme
|
readwrite |
Allows to select the preferred key binding, by default there is one pre-defined.
Definition at line 44 of file ksession.h.
◆ monitorSilence
|
readwrite |
Whether to monitor when the session has gone silent.
Definition at line 94 of file ksession.h.
◆ shellProgram
|
readwrite |
Allows to change the default shell program, by default bash is used.
Definition at line 59 of file ksession.h.
◆ shellProgramArgs
|
readwrite |
Allows to set the arguments to the default shell program.
Definition at line 64 of file ksession.h.
◆ title
|
readwrite |
The session title.
Definition at line 54 of file ksession.h.
Constructor & Destructor Documentation
◆ KSession()
| KSession::KSession | ( | QObject * | parent = nullptr | ) |
Definition at line 38 of file ksession.cpp.
◆ ~KSession()
| KSession::~KSession | ( | ) |
Definition at line 104 of file ksession.cpp.
Member Function Documentation
◆ addView()
| void KSession::addView | ( | TerminalDisplay * | display | ) |
◆ args
|
slot |
◆ argsChanged
|
signal |
argsChanged
◆ availableKeyBindings()
|
static |
Sets whether the flow control warning box should be shown when the flow control stop key (Ctrl+S) is pressed.
Get all available keyboard bindings
- Returns
Definition at line 401 of file ksession.cpp.
◆ bellRequest
|
signal |
bellRequest
- Parameters
-
message
◆ changeDir
|
slot |
◆ changedKeyBindings
|
signal |
changedKeyBindings
- Parameters
-
kb
◆ clearScreen
|
slot |
clearScreen
Definition at line 367 of file ksession.cpp.
◆ copyAvailable
|
signal |
copyAvailable
◆ currentDir()
| QString KSession::currentDir | ( | ) |
Returns the current working directory of the process.
◆ currentDirChanged
|
signal |
currentDirChanged
◆ finished
|
signal |
finished
◆ flowControlEnabled()
| bool KSession::flowControlEnabled | ( | void | ) |
◆ foregroundProcessName()
| QString KSession::foregroundProcessName | ( | ) |
Returns the name of the terminal's foreground process.
◆ foregroundProcessNameChanged
|
signal |
foregroundProcessNameChanged
◆ getForegroundProcessError
|
slot |
Definition at line 113 of file ksession.cpp.
◆ getHistory()
| QString KSession::getHistory | ( | ) | const |
Definition at line 332 of file ksession.cpp.
◆ getInitialWorkingDirectory()
| QString KSession::getInitialWorkingDirectory | ( | ) |
Definition at line 290 of file ksession.cpp.
◆ getKeyBindings()
| QString KSession::getKeyBindings | ( | ) |
Definition at line 396 of file ksession.cpp.
◆ getRandomSeed()
| int KSession::getRandomSeed | ( | ) |
Definition at line 183 of file ksession.cpp.
◆ getShellPID
|
slot |
◆ getTitle()
| QString KSession::getTitle | ( | ) |
Definition at line 411 of file ksession.cpp.
◆ hasActiveProcess()
| bool KSession::hasActiveProcess | ( | ) | const |
Returns true if the session has an active subprocess running in it spawned from the initial shell.
Definition at line 425 of file ksession.cpp.
◆ hasActiveProcessChanged
|
signal |
hasActiveProcessChanged
◆ historySize()
| int KSession::historySize | ( | ) | const |
Definition at line 322 of file ksession.cpp.
◆ historySizeChanged
|
signal |
historySizeChanged
◆ initialWorkingDirectoryChanged
|
signal |
initialWorkingDirectoryChanged
◆ keyBindings()
| QString KSession::keyBindings | ( | ) |
◆ matchFound
|
signal |
matchFound
- Parameters
-
startColumn startLine endColumn endLine
◆ monitorSilence()
| bool KSession::monitorSilence | ( | ) | const |
◆ monitorSilenceChanged
|
signal |
monitorSilenceChanged
◆ noMatchFound
|
signal |
noMatchFound
◆ processHasSilent
|
signal |
processHasSilent
- Parameters
-
value
◆ removeView()
| void KSession::removeView | ( | TerminalDisplay * | display | ) |
◆ search
|
slot |
Search history.
- Parameters
-
regexp startLine startColumn forwards
Definition at line 372 of file ksession.cpp.
◆ selectionChanged
|
slot |
Definition at line 203 of file ksession.cpp.
◆ sendKey
|
slot |
◆ sendSignal
|
slot |
◆ sendText
|
slot |
◆ sessionFinished
|
protectedslot |
Definition at line 198 of file ksession.cpp.
◆ setArgs
|
slot |
◆ setEnvironment()
| void KSession::setEnvironment | ( | const QStringList & | environment | ) |
Set the custom enviroment variables.
- Parameters
-
environment
Definition at line 260 of file ksession.cpp.
◆ setFlowControlEnabled()
| void KSession::setFlowControlEnabled | ( | bool | enabled | ) |
Sets whether flow control is enabled.
- Parameters
-
enabled
Definition at line 380 of file ksession.cpp.
◆ setHistorySize()
| void KSession::setHistorySize | ( | int | lines | ) |
◆ setInitialWorkingDirectory()
| void KSession::setInitialWorkingDirectory | ( | const QString & | dir | ) |
◆ setKeyBindings
|
slot |
Set named key binding for the session.
Definition at line 390 of file ksession.cpp.
◆ setMonitorSilence()
| void KSession::setMonitorSilence | ( | bool | value | ) |
◆ setShellProgram
|
slot |
Shell program, default is /bin/bash
- Parameters
-
progname
Definition at line 265 of file ksession.cpp.
◆ setTextCodec()
| void KSession::setTextCodec | ( | QTextCodec * | codec | ) |
◆ setTitle
|
slot |
◆ shellProgram
|
slot |
◆ shellProgramChanged
|
signal |
shellProgramChanged
◆ started
|
signal |
started
◆ startShellProgram
|
slot |
startShellProgram
Definition at line 208 of file ksession.cpp.
◆ termGetFocus
|
signal |
termGetFocus
◆ termKeyPressed
|
signal |
termKeyPressed
◆ termLostFocus
|
signal |
termLostFocus
◆ titleChanged
|
signal |
titleChanged
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 11:55:37 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.
Properties inherited from