MauiKit Terminal
Session.cpp
85 connect(_emulation.get(), &Emulation::changeTabTextColorRequest, this, &Session::changeTabTextColorRequest);
86 connect(_emulation.get(), &Emulation::profileChangeCommandReceived, this, &Session::profileChangeCommandReceived);
88 connect(_emulation.get(), &Emulation::imageResizeRequest, this, &Session::onEmulationSizeChange);
99 connect(_shellProcess.get(), qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, &Session::done);
160 connect(widget, &TerminalDisplay::keyPressedSignal, _emulation.get(), &Emulation::sendKeyEvent);
168 connect(_emulation.get(), &Emulation::programUsesMouseChanged, widget, &TerminalDisplay::setUsesMouse);
172 connect(_emulation.get(), &Emulation::programBracketedPasteModeChanged, widget, &TerminalDisplay::setBracketedPasteMode);
180 QObject::connect(widget, &TerminalDisplay::changedContentSizeSignal, this, &Session::onViewSizeChange);
225 /* ok iam not exactly sure where _program comes from - however it was set to /bin/bash on my system
226 * Thats bad for BSD as its /usr/local/bin/bash there - its also bad for arch as its /usr/bin/bash there too!
227 * So i added a check to see if /bin/bash exists - if no then we use $SHELL - if that does not exist either, we fall back to /bin/sh
228 * As far as i know /bin/sh exists on every unix system.. You could also just put some ifdef __FREEBSD__ here but i think these 2 filechecks are worth
229 * their computing time on any system - especially with the problem on arch linux beeing there too.
247 qWarning() << "Neither default shell nor $SHELL is set to a correct path. Fallback to" << defaultShell;
266 QString backgroundColorHint = _hasDarkBackground ? QLatin1String("COLORFGBG=15;0") : QLatin1String("COLORFGBG=0;15");
395 // FIXME: The idea here is that the notification popup will appear to tell the user than output from
401 // FIXME: Make message text for this notification and the activity notification more descriptive.
453 _shellProcess->setWindowSize(_view->columns(), _view->lines(), _view->width(), _view->height());
474 _shellProcess->setWindowSize(existingSize.height(), existingSize.width() + 1, existingPixelSize.height(), existingPixelSize.width());
915 disconnect(master->emulation(), &Emulation::sendData, other->emulation(), &Emulation::sendString);
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:220
void imageSizeChanged(int lineCount, int columnCount)
Emitted when the program running in the terminal changes the screen size.
void programUsesMouseChanged(bool usesMouse)
This is emitted when the program running in the shell indicates whether or not it is interested in mo...
void imageResizeRequest(const QSize &sizz)
Emitted after receiving the escape sequence which asks to change the terminal emulator's size.
void profileChangeCommandReceived(const QString &text)
Emitted when the terminal program requests to change various properties of the terminal display.
void changeTabTextColorRequest(int color)
Requests that the color of the text used to represent the tabs associated with this emulation be chan...
void stateSet(int state)
Emitted when the activity state of the emulation is set.
void titleChanged(int title, const QString &newTitle)
Emitted when the program running in the terminal wishes to update the session's title.
virtual void sendKeyEvent(QKeyEvent *, bool fromPaste)
Interprets a key press event and emits the sendData() signal with the resulting character stream.
Definition Emulation.cpp:204
void cursorChanged(KeyboardCursorShape cursorShape, bool blinkingCursorEnabled)
Emitted when the cursor shape or its blinking state is changed via DECSCUSR sequences.
void sendData(const char *data, int len)
Emitted when a buffer of data is ready to send to the standard input of the terminal.
void useUtf8Request(bool)
Requests that the pty used by the terminal process be set to UTF 8 mode.
void setCodec(const QTextCodec *)
Sets the codec used to decode incoming characters.
Definition Emulation.cpp:143
virtual void sendString(const char *string, int length=-1)=0
Sends a string of characters to the foreground terminal process.
Definition Emulation.cpp:215
static std::unique_ptr< 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:1182
void receivedData(const char *buffer, int length)
Emitted when a new block of data is received from the teletype.
void sendData(const QByteArray &data)
Sends data to the process currently controlling the teletype ( whose id is returned by foregroundProc...
Definition Pty.cpp:78
void setUtf8Mode(bool on)
Put the pty into UTF-8 mode on systems which support it.
Definition Pty.cpp:162
void setMasterStatus(Session *session, bool master)
Sets whether a particular session is a master within the group.
Definition Session.cpp:877
QList< Session * > sessions() const
Returns the list of sessions currently in the group.
Definition Session.cpp:815
@ CopyInputToAll
Any input key presses in the master sessions are sent to all sessions in the group.
Definition Session.h:632
~SessionGroup() override
Destroys the session group and removes all connections between master and slave sessions.
Definition Session.cpp:806
void setMasterMode(int mode)
Specifies which activity in the group's master sessions is propagated to all sessions in the group.
Definition Session.cpp:846
bool masterStatus(Session *session) const
Returns the master status of a session.
Definition Session.cpp:819
int masterMode() const
Returns a bitwise OR of the active MasterMode flags for this group.
Definition Session.cpp:811
Represents a terminal session consisting of a pseudo-teletype and a terminal emulation.
Definition Session.h:54
QString tabTitleFormat(TabTitleContext context) const
Returns the format used by this session for tab titles.
Definition Session.cpp:382
QString title(TitleRole role) const
Returns the session's title for the specified role.
Definition Session.cpp:592
void receivedData(const QString &text)
Emitted when output is received from the terminal process.
void setIconName(const QString &iconName)
Sets the name of the icon associated with this session.
Definition Session.cpp:603
bool flowControlEnabled() const
Returns whether flow control is enabled for this terminal session.
Definition Session.cpp:719
TabTitleContext
This enum describes the contexts for which separate tab title formats may be specified.
Definition Session.h:153
@ RemoteTabTitle
Tab title format used session currently contains a connection to a remote computer (via SSH)
Definition Session.h:160
void setProgram(const QString &program)
Sets the program to be executed when run() is called.
Definition Session.cpp:135
QString foregroundProcessName()
Returns the name of the terminal's foreground process.
Definition Session.cpp:748
QString profileKey() const
Returns the profile key associated with this session.
Definition Session.cpp:517
bool isMonitorSilence() const
Returns true if monitoring for inactivity (silence) in the session is enabled.
Definition Session.cpp:663
void setCodec(QTextCodec *codec) const
Sets the text codec used by this session's terminal emulation.
Definition Session.cpp:130
void setHistoryType(const HistoryType &type)
Sets the type of history store used by this session.
Definition Session.cpp:632
QString iconName() const
Returns the name of the icon associated with this session.
Definition Session.cpp:617
void setDarkBackground(bool darkBackground)
Sets whether the session has a dark background or not.
Definition Session.cpp:117
void setIconText(const QString &iconText)
Sets the text of the icon associated with this session.
Definition Session.cpp:611
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:143
Emulation * emulation() const
Returns the terminal emulation instance being used to encode / decode characters to / from the proces...
Definition Session.cpp:549
void flowControlEnabledChanged(bool enabled)
Emitted when the flow control state changes.
void profileChanged(const QString &profile)
Emitted when the session's profile has changed.
QStringList environment() const
Returns the environment of this session as a list of strings like VARIABLE=VALUE.
Definition Session.cpp:559
void setTabTitleFormat(TabTitleContext context, const QString &format)
Sets the format used by this session for tab titles.
Definition Session.cpp:374
const HistoryType & historyType() const
Returns the type of history store used by this session.
Definition Session.cpp:637
bool sendSignal(int signal)
Sends the specified signal to the terminal process.
Definition Session.cpp:478
void setMonitorSilence(bool)
Enables monitoring for silence in the session.
Definition Session.cpp:676
void changeTabTextColorRequest(int)
Requests that the color the text for any tabs associated with this session should be changed;.
void stateChanged(int state)
Emitted when the activity state of this session changes.
void runEmptyPTY()
Starts the terminal session for "as is" PTY (without the direction a data to internal terminal proces...
Definition Session.cpp:283
void setProfileKey(const QString &profileKey)
Sets the profile associated with this session.
Definition Session.cpp:511
void setFlowControlEnabled(bool enabled)
Sets whether flow control is enabled for this terminal session.
Definition Session.cpp:705
void changeBackgroundColorRequest(const QColor &)
Requests that the background color of views on this session should be changed.
void setTitle(TitleRole role, const QString &title)
Sets the session's title for the specified role to title.
Definition Session.cpp:579
void setAddToUtmp(bool)
Specifies whether a utmp entry should be created for the pty used by this session.
Definition Session.cpp:700
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:139
bool hasDarkBackground() const
Returns true if the session has a dark background.
Definition Session.cpp:121
void cursorChanged(Emulation::KeyboardCursorShape cursorShape, bool blinkingCursorEnabled)
Broker for Emulation::cursorChanged() signal.
bool isMonitorActivity() const
Returns true if monitoring for activity is enabled.
Definition Session.cpp:658
void setUserTitle(int, const QString &caption)
Changes the session title or other customizable aspects of the terminal emulation display.
Definition Session.cpp:295
void setEnvironment(const QStringList &environment)
Sets the environment for this session.
Definition Session.cpp:564
void refresh()
Attempts to get the shell program to redraw the current display area.
Definition Session.cpp:456
QString program() const
Returns the program name of the shell process started when run() is called.
Definition Session.cpp:652
QStringList arguments() const
Returns the arguments passed to the shell process when run() is called.
Definition Session.cpp:647
@ DisplayedTitleRole
The title of the session which is displayed in tabs etc.
Definition Session.h:264
void bellRequest(const QString &message)
Emitted when a bell event occurs in the session.
void setKeyBindings(const QString &id)
Sets the key bindings used by this session.
Definition Session.cpp:574
void profileChangeCommandReceived(const QString &text)
Emitted when a profile change command is received from the terminal.
void sendText(const QString &text) const
Sends text to the current foreground terminal program.
Definition Session.cpp:499
void setMonitorActivity(bool)
Enables monitoring for activity in the session.
Definition Session.cpp:668
QString iconText() const
Returns the text of the icon associated with this session.
Definition Session.cpp:622
bool isTitleChanged() const
Flag if the title/icon was changed by user/shell.
Definition Session.cpp:627
int foregroundProcessId() const
Returns the process id of the terminal's foreground process.
Definition Session.cpp:743
void setSize(const QSize &size)
Emits a request to resize the session to accommodate the specified window size.
Definition Session.cpp:735
static QString expand(const QString &text)
Expands environment variables in text .
Definition ShellCommand.cpp:71
A widget which displays output from a terminal emulation and sends input keypresses and mouse activit...
Definition TerminalDisplay.h:89
void setUsesMouse(bool usesMouse)
Sets whether the program whoose output is being displayed in the view is interested in mouse events.
Definition TerminalDisplay.cpp:2360
void keyPressedSignal(QKeyEvent *e, bool fromPaste)
Emitted when the user presses a key whilst the terminal widget has focus.
void mouseSignal(int button, int column, int line, int eventType)
A mouse event occurred.
void setScreenWindow(ScreenWindow *window)
Sets the terminal screen section which is displayed in this widget.
Definition TerminalDisplay.cpp:95
bool isValid() const const
QString currentPath()
QString homePath()
QByteArray encodeName(const QString &fileName)
bool exists(const QString &fileName)
void setFileName(const QString &name)
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void destroyed(QObject *obj)
bool disconnect(const QMetaObject::Connection &connection)
QString tr(const char *sourceText, const char *disambiguation, int n)
NormalExit
Running
void finished(int exitCode, QProcess::ExitStatus exitStatus)
height
width
int height() const const
int width() const const
QString arg(Args &&... args) const const
void clear()
QString fromLatin1(QByteArrayView str)
QString fromLocal8Bit(QByteArrayView str)
bool isEmpty() const const
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
QString section(QChar sep, qsizetype start, qsizetype end, SectionFlags flags) const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
void setSingleShot(bool singleShot)
void start()
void stop()
void timeout()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:55:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:55:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.