Currently, all the processes created by the application are housed
within the application's cgroup without any futher categorisation.
This causes the entire application to be killed if a process in the
aforementioned cgroup triggers an OOM event.
To prevent the entire application from being killed, a new child cgroup
is created for each new tab. Child cgroups for individual tabs are
named according to this template "tab([session pid for the tab]).scope".
"Background" processes (e.g. such as the main process for running
konsole) are stored in the child cgroup "main.scope".
This restricts the OOM event to only killing the tab which contains
the offending process.
BUG: 439805
To prevent the entire application from being killed, a new child cgroup is created for each new tab.
Child cgroups for individual tabs are named according to this template "tab([session pid for the tab]).scope".
"Background" processes (e.g. such as the main process for running konsole) are stored in the child cgroup "main.scope".
This restricts the OOM event to only killing the tab which contains the offending process.
BUG: 439805
Certain user profiles crash here
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
this=0x5555557c8da0, name=..., visible=true)
at src/konsole/src/session/SessionController.cpp:2206
mode=1) at src/konsole/src/Screen.cpp:2395
at src/konsole/src/Vt102Emulation.cpp:1071
this=0x555555dc2a30, cc=7)
Validate process id of 'top'" for three systems: Solars, OpenBSD and
Linux. This is done by confirming that the return value of
TerminalInterface::foregroundProcessId belongs to a process and that
the process has the correct name. For Linux, this entails reading the
name of the process from /proc/%pid/stat. For Solaris, this entails
reading from /proc/%pid/execname. For OpenBSD, this is done through
the p_comm field of a struct kinfo_proc returned by a call to kvm_getprocs.
For Linux platforms, this change resolves this issue by verifying that
TerminalInterface::terminalProcessId returns an id for a process with an
executable that has a path matching the user default shell set in /etc/passwd.
Valid file names for executables can contain '(', ')' or ' '.
Some odd but legal executable names include "a) (b", "(a" and "b)".
The above examples will lead to incorrect tab titles due to incorrect
parsing of the tab names.
This change finds the index of the last character of the name field by
searching for the last occurence of ')'. The search encompasses a range
of 16 characters starting from the starting index of the name field.
This change relies on the field in /proc/%pid/stat containing the name
of the process to start with '(' and ends with ')'. It also relies on
the fact that the maximum length of the name of a process is 16 characters.
Lastly, it relies on the rest of the contents of /proc/%pid/stat not
containing parentheses.
BUG: 470074
Qt 6 includes `Q_ASSERT(rc <= 0xffff)` in the QChar constructor.
This causes Qt 6 builds of Konsole to segfault when entering an
emoji or when a script is printing an emoji.
* speeds up incremental builds as changes to a header will not always
need the full mocs_compilation.cpp for all the target's headers rebuild,
while having a moc file sourced into a source file only adds minor
extra costs, due to small own code and the used headers usually
already covered by the source file, being for the same class/struct
* seems to not slow down clean builds, due to empty mocs_compilation.cpp
resulting in those quickly processed, while the minor extra cost of the
sourced moc files does not outweigh that in summary.
Measured times actually improved by some percent points.
(ideally CMake would just skip empty mocs_compilation.cpp & its object
file one day)
* enables compiler to see all methods of a class in same compilation unit
to do some sanity checks
* potentially more inlining in general, due to more in the compilation unit
* allows to keep using more forward declarations in the header, as with the
moc code being sourced into the cpp file there definitions can be ensured
and often are already for the needs of the normal class methods
Qt Designer (accidentally) injected "." file names as fallback when
setting theme icon names, which then results in generated code like:
QIcon icon;
QString iconThemeName = QString::fromUtf8("list-add");
if (QIcon::hasThemeIcon(iconThemeName)) {
icon = QIcon::fromTheme(iconThemeName);
} else {
icon.addFile(QString::fromUtf8("."), QSize(), QIcon::Normal, QIcon::Off);
}
Such a "." file name is not documented to serve any purpose, just results
in failing icon lookup.
When Qt is configured with `QT_USE_PROTECTED_VISIBILITY`
then `Q_DECL_EXPORT` will resolve as `visibility("protected")`
which will prevent `KonsoleSettings` being usable from other modules
To solve this issue we use our own export definition
KUrlRequester::filter property does not support MIME type names since KF5,
support was lost with switch KFileDialog->QFileDialog for kdelibs4->KF5.
A MIME type filter now needs to be set by the method setMimeTypeFilters.
(cherry picked from commit b9e6d1afe0)
kcfg_scrollbackUseSpecifiedLocationDirectory is in directory-pick mode,
where the file filter is ignored.
KUrlRequester::filter also does not support MIME type names in KF5.
GIT_SILENT
(cherry picked from commit 25f775f496)
As advised by docs and to prevent false error of failing KDEMetaInfoPlatformCheck due to missing metainfo.yaml file. Also corrected ambiguous operator overload which were causing compilation errors.
To prevent the search bar from continuing to show a match by emitting
green even after clearing scrollback and resetting, search is rerun
whenever the searchbar is opened.
BUG: 407317
_showAllFonts and _showAllFontsWarning widgets only have functionality for non emoji font selection dialog.
They are shown as redundant and blank widgets at a misplaced position for emoji font selection dialog.
This change simply hides them.
BUG: 469563
The selection point coordinates are relative to the start of the
scrollback, so when the scrollback shrinks, either because it is limited
to some amount of lines, or because it is cleared, we could end up with
stale coordinates which could cause a crash on a subsequent selection
extend operation.
BUG: 470346