Commit Graph

5855 Commits

Author SHA1 Message Date
Theodore Wang
1525ee3b5e Create separate cgroups for processes of each tab
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
2023-08-28 23:59:16 +00:00
l10n daemon script
1c70edcd15 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-08-21 01:38:28 +00:00
Kurt Hindenburg
5bda57405e Fix crashes in testTerminalInterface
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)
2023-08-18 20:14:16 -04:00
Theodore Wang
cd80ed3697 Validates pid returned by TerminalInterface::foregroundProcessId
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.
2023-08-18 21:08:50 +00:00
Nicolas Fella
f3a9066dd5 Port away from KNotification::CloseWhenWidgetActivated 2023-08-17 19:45:37 +00:00
Nicolas Fella
7d286e595c Adapt to kbookmarks API change 2023-08-14 23:37:09 +02:00
Theodore Wang
10468f158b Check terminalProcessId executable against user shell in TerminalInterfaceTest
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.
2023-08-13 13:46:11 +00:00
Christoph Cullmann
273eb128d8 add missing forward declaration 2023-08-12 17:54:08 +02:00
Kurt Hindenburg
00717f7031 Fix spelling in commment 2023-08-12 03:07:17 -04:00
Theodore Wang
48523348d9 Resolve parsing issues for certain process names to fix incorrect tab titles
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
2023-08-12 07:04:02 +00:00
Juerd Waalboer
9dfcd62eba Calculate splitter sizes when child is removed
Has as sizeable comment because the cause and fix are non-obvious and
the fix is based on the underdocumented QSplitter::refresh().

BUG: 472641
2023-08-11 23:39:11 +00:00
Méven Car
b2ac4cd0b0 ScreenWindow::updateCurrentLine: Better bound currentLine 2023-08-11 21:50:58 +00:00
l10n daemon script
25193b3387 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-08-01 01:44:09 +00:00
Nicolas Fella
8dca651964 Add missing KService link 2023-07-29 19:24:59 +02:00
Aaron Dewes
366654e30e Don't crash if a character is not a valid char in isSpace()
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.
2023-07-28 16:49:49 +00:00
Friedrich W. H. Kossebau
451ed33d63 Add explicit moc includes to sources for moc-covered headers
* 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
2023-07-28 12:17:12 +00:00
l10n daemon script
b66a4b9203 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-07-27 01:39:19 +00:00
l10n daemon script
8e8b9ffb8c SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-07-24 08:34:39 +00:00
l10n daemon script
d75a7532d8 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-07-21 01:49:32 +00:00
Laurent Montel
e097910eeb Remove Designer's "." normaloff file data from icon properties in .ui files
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.
2023-07-19 19:37:49 +02:00
Laurent Montel
5609d12642 Add isEmpty() here 2023-07-16 08:34:33 +00:00
Laurent Montel
125b81654f Fix compile warning about QString::count() 2023-07-16 08:34:33 +00:00
l10n daemon script
6013afa68c SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-07-16 01:48:37 +00:00
l10n daemon script
c9f1681647 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-07-05 02:00:44 +00:00
Dāvis Mosāns
6e73ca9ee7 Fix build with QT_USE_PROTECTED_VISIBILITY
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
2023-07-01 07:27:34 +00:00
Friedrich W. H. Kossebau
028f0dd741 Tab bar settings: fix MIME type filtering of custom CSS file picker
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)
2023-07-01 00:04:33 +02:00
Friedrich W. H. Kossebau
cd61624552 Temporary file settings: remove ununsed (&broken) css MIME type file filter
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)
2023-07-01 00:04:20 +02:00
Theodore Wang
0452927792 Remove usage of KDEFrameworkCompilerSettings
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.
2023-06-19 21:13:32 +00:00
l10n daemon script
0cc9d51967 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-06-18 01:55:34 +00:00
Theodore Wang
09237ee02f Fixed search bar false positive after clear scrollback (and reset)
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
2023-06-16 17:10:58 +00:00
l10n daemon script
08f7279ee9 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-06-13 01:45:49 +00:00
Theodore Wang
4ad81a7717 Hides redundant widgets on dialog for emoji font selection
_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
2023-06-12 12:19:42 +00:00
l10n daemon script
3c231a23df SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-06-12 01:59:04 +00:00
l10n daemon script
4f37f8e6fb SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-06-11 01:44:06 +00:00
l10n daemon script
73d0679912 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-06-09 01:47:01 +00:00
l10n daemon script
b767efdca9 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-06-07 01:45:23 +00:00
Theodore Wang
c80d012773 Eliminate compilation warnings for plugins from using QAction::setShortcut(s)
Replaced QAction::setShortcut(s) with KActionCollection::setDefaultShortcut(s)
to eliminate compilation warnings

BUG: 462615
2023-06-06 21:28:27 +00:00
Kurt Hindenburg
d8d5744e60 Remove unused debugging variable
It doesn't appear this has been used in 10+ years.
2023-06-04 18:51:13 -04:00
l10n daemon script
30c6b93b20 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-06-03 01:42:08 +00:00
l10n daemon script
90c8802c2b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-06-02 01:43:16 +00:00
Luis Javier Merino Morán
28931090bc Adjust selection point coords when scrollback shrinks
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
2023-06-01 06:24:55 +00:00
l10n daemon script
182d3d1843 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-06-01 01:42:06 +00:00
l10n daemon script
e120d8441d SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-05-31 01:43:28 +00:00
l10n daemon script
03608f3aa0 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-05-30 01:44:09 +00:00
Nicolas Fella
88240c43a8 Adapt to KIconThemes changes
KIconDialog is in a new library now
2023-05-29 18:49:53 +02:00
Tobias Fella
53d473cff3 Port to KF6 2023-05-29 16:17:23 +00:00
Kurt Hindenburg
7f6b3d97d2 Fix spelling error 2023-05-23 22:12:51 -04:00
Kurt Hindenburg
ace05e7a92 Remove unwanted warning output 2023-05-23 22:09:36 -04:00
Martin T. H. Sandsmark
df7a462f85 Fix compatibility with xterm's OSC 104 without arguments
It is called by `reset`.
2023-05-16 13:58:57 +00:00
Kurt Hindenburg
eec2e87e92 For plugins, only check RELEASE VERSION MAJOR and MINOR XX.YY 2023-05-15 06:49:11 +00:00