Commit Graph

5911 Commits

Author SHA1 Message Date
Carl Schwan
f0c8210ad3 Use new setObjectName StringView overload 2023-11-27 16:45:19 +01:00
Carl Schwan
66d1140f12 Improve spacing of the profile pages
- Remove frames around groupbox and tab widgets
- Don't overwrite margins to 0 for page that are not frameless
2023-11-26 19:49:05 +01:00
Christoph Cullmann
8a0ea5ec91 remove millions of allocations
use one string to convert into

running konsole and doing multiple

dmesg -T

outputs this moves from

calls to allocation functions:
1.875.517 (148.838/s)
temporary allocations:
1.089.598 (58,1%, 86.469/s)

to

calls to allocation functions:
967.566 (102.096/s)
temporary allocations:
216.914 (22,42%, 22.888/s)

even for small runs
2023-11-24 15:15:36 +00:00
Ilya Pominov
0b31bd192a Fix missing actions from the Plugins menu
After editing the toolbars, all actions disappear from the Plugins menu.

Steps to reproduce:
1. Change the toolbars settings and click apply
(Settings->Configure Toolbars...)
2. Check the contents of the Plugins menu

Expected Result:
The contents of the Plugins menu have not changed

Observed result:
The Plugins menu is empty
2023-11-24 15:06:36 +00:00
Ilya Pominov
f7d0c2ae7d Change session Id numbering
Assign the new session Id equal to the maximum existing Id + 1.

The session Id may be displayed in the tab title. If we open 2 tabs and
then close the second one, then the next opened tab will get number 3
instead of number 2, which can be confusing for the user.

BUG: 440878
2023-11-24 15:00:36 +00:00
Méven Car
f73e3bccb9 quickcommandswidget: better inform user about shellcheck, check for its presence more often 2023-11-24 10:55:12 +01:00
Petr Vanek
77755fc0cc Apply split view icons to the session context menu too. 2023-11-21 09:19:37 +00:00
Ilya Pominov
a9caaeb8fc Remove some unused includes 2023-11-19 16:53:44 +00:00
Eli MacKenzie
bb6499131e Clarify the label text for EnableMemoryMonitoring 2023-11-15 01:25:07 -05:00
Carl Schwan
d7767acf16 Improve consistency of margins inside settings 2023-11-13 17:12:23 +00:00
Waqar Ahmed
bebcf4054f Fix uninitialized var in TerminalDisplay
Fixes the following warning reported by ubsan:

TerminalDisplay.h:297:16: runtime error: load of value 190, which is not a valid value for type 'bool'
2023-11-13 01:12:31 +05:00
Haochen Tong
92a48292ec Fix transparency on Wayland when HAVE_X11 is true 2023-11-12 12:24:26 +08:00
Laurent Montel
1abfaaf561 GIT_SILENT: adapt to new api 2023-11-09 06:50:52 +01:00
Matan Ziv-Av
b6dc6c1eab Properly set line properties when reflowing lines
The flags for a line that is the first in prompt/input/output block
should only be for the first line.

- When splitting a long line to two lines, don't copy those flags.
- When merging two lines, use those flags from the first one.

This fixes bugs reported here: https://gitlab.gnome.org/GNOME/vte/-/issues/2681#note_1903991
2023-11-07 14:28:23 +00:00
Kai Uwe Broulik
a6d366f1fb TerminalPainter: Fix font width on Qt 6
There is no QFont::ForceIntegerMetrics anymore.
Instead, enable full hinting to ensure the letters are aligned correctly.
2023-11-07 14:03:26 +00:00
Christoph Cullmann
3056d6009d port from deprecated Qt event & position functions
for the dragging, we can just use the floats,
rounding doesn't make it better
2023-11-05 09:14:03 +00:00
Christoph Cullmann
0657a54593 use proper string type 2023-11-05 09:14:03 +00:00
Tomaz Canabrava
b225560dff use char32_t instead of uint
This helps with the understanding that we are indeed
handling character codepoints, and not numbers.
This was needed to ensure we don't use deprecated function
calls from Qt, but, all in all, it's a good change
2023-11-05 09:14:03 +00:00
l10n daemon script
d18f4a266a 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-11-05 01:38:18 +00:00
Christoph Cullmann
0b3b21bf7c fix warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) 2023-11-04 17:39:01 +01:00
Nicolas Fella
ccefad2839 Port to new KNotifications action API 2023-11-04 16:26:43 +00:00
Christoph Cullmann
f0c6c7cfab fix warnings about not used fields and functions 2023-11-04 17:21:47 +01:00
Kurt Hindenburg
154cce9567 Q_OS_WIN: if MAX_PATH not found, use default 259
This is a quick fix
BUG: 476032
2023-10-27 19:19:23 -04:00
Laurent Montel
a751faf02a Remove unused now qt5 code. Master is qt6 only now 2023-10-27 06:34:56 +00:00
Laurent Montel
73295a8557 Use std::as_const (we depend against c++17) 2023-10-27 05:52:51 +00:00
Waqar Ahmed
851cfecf98 Merge TerminalInterfaceV2 into TerminalInterface 2023-10-26 17:16:46 +05:00
l10n daemon script
5bc5b6e9b2 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-10-26 02:20:37 +00:00
Christoph Cullmann
5559921eaf use env getter that returns QString 2023-10-25 20:30:22 +02:00
Christoph Cullmann
07a4006eee fix unit test build 2023-10-25 20:23:00 +02:00
Waqar Ahmed
1e136d63f2 move konsole to kf6 2023-10-25 22:13:53 +05:00
Friedrich W. H. Kossebau
c11a3f668e Adapt to change of KStandardAction::name(id) return type
GIT_SILENT
2023-10-24 02:21:53 +02:00
Nicolas Fella
036e8d5073 Adapt to KBookmarkManager API change 2023-10-20 16:53:24 +02:00
Juerd Waalboer
f012d1304f Add zoom-maximize feature to maximize with scaled font
This aims to duplicate the feature "scaled_zoom" of Terminator. This way
of expanding the current terminal is only useful for split views that
have both horizontal and vertical splits, i.e. where the individual
terminal view is smaller than the window in both directions.

The default shortcut is Ctrl+Shift+Z. It is usually bound to Redo, but
since there's no Undo or Redo in terminals, this doesn't actually clash
here.

The magic constant 0.97 comes from Terminator, although in Terminator
the scale factor is calculated using the new number of columns/lines
after resizing, while this commit bases the font size on the sizes in
pixels. In the commit message that introduced the magic value in
Terminator, it is explained as "just more natural", and it seems to work
here too, unlike the vertical magical constant of 1.05. This is all
mostly guesswork, though, as font sizes aren't an exact science - not
even the aspect ratio is guaranteerd to remain the same between font
sizes, just like the aspect ratio before and after maximizing could be
different in the terminal.
2023-10-13 18:01:00 +00:00
Theodore Wang
9d34572d31 Implement unit tests for ProcessInfo
With this change, the tests which are implemented check that ProcessInfo can read attributes of a process properly.
The checked attributes are the current working directory of the process, the validity of the process and the name and arguments of the process.
2023-10-11 20:22:04 +00:00
Kurt Hindenburg
66e5941f99 Add copyright and license headers 2023-10-11 15:57:06 -04:00
Waqar Ahmed
511512c5ca Fix signed integer overflow due to uninitialized vars warning
Fixes:

Screen.cpp:907:19: runtime error: signed integer overflow:
-1094795598 * 80 cannot be represented in type 'int'

Caught by ubsan
2023-10-10 21:23:44 +05:00
l10n daemon script
026750e233 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-10-09 01:22:06 +00:00
Theodore Wang
f0ee5a1163 Implements public method ProcessInfo::refreshArguments
Instead of calling ProcessInfo::readArguments and
ProcessInfo::clearArguments in ProcessInfo::update,
encapsulate logic of refreshing ProcessInfo::_arguments
into ProcessInfo::refreshArguments and call
the method whenever ssh is detected as process.
2023-10-08 13:19:54 +00:00
Theodore Wang
1b50142053 Calls ProcessInfo::readArguments periodically on ProcessInfo::update
When ssh is run via 'exec ssh [ssh arguments]', ProcessInfo::_arguments
is not updated since ProcessInfo::readArguments is only called once when
the process is started. Thus, SSHProcessInfo::SSHProcessInfo will have
soft errors since it relies heavily on reading ProcessInfo::_arguments
which are outdated. A solution is to call ProcessInfo::clearArguments
followed by ProcessInfo::readArguments whenever ProcessInfo::update
is called if there is a change in process name.
2023-10-08 13:19:54 +00:00
Nicolas Fella
6e7decd4a0 Adapt to new KBookmarksWidgets library 2023-10-07 16:56:30 +00:00
Spyridon Alatopoulos
eb9673145a Add support for animated wallpaper image 2023-10-06 16:17:26 +00:00
Aleix Pol
475da6fb23 Make sure we don't crash if we issue a notification before showing the window
Could reproduce running `konsole -e "cat unexisting.file"`

See:
```
* 0  QWidget::windowHandle (this=0x0) at /home/apol/devel/frameworks/qt6/qtbase/src/widgets/kernel/qwidget.cpp:2498
* 1  0x00007ffff7d38070 in Konsole::Session::done (this=0x55555572cf50, exitCode=1, exitStatus=QProcess::NormalExit) at /home/apol/devel/frameworks6/konsole/src/session/Session.cpp:1099
* 2  0x00007ffff7d49b01 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<int, QProcess::ExitStatus>, void, void (Konsole::Session::*)(int, QProcess::ExitStatus)>::call (
    f=(void (Konsole::Session::*)(Konsole::Session * const, int, QProcess::ExitStatus)) 0x7ffff7d37db0 <Konsole::Session::done(int, QProcess::ExitStatus)>, o=0x55555572cf50, arg=0x7fffffffd350) at /home/apol/devel/kde6/include/QtCore/qobjectdefs_impl.h:145
* 3  0x00007ffff7d49a3d in QtPrivate::FunctionPointer<void (Konsole::Session::*)(int, QProcess::ExitStatus)>::call<QtPrivate::List<int, QProcess::ExitStatus>, void> (
    f=(void (Konsole::Session::*)(Konsole::Session * const, int, QProcess::ExitStatus)) 0x7ffff7d37db0 <Konsole::Session::done(int, QProcess::ExitStatus)>, o=0x55555572cf50, arg=0x7fffffffd350) at /home/apol/devel/kde6/include/QtCore/qobjectdefs_impl.h:182
* 4  0x00007ffff7d49965 in QtPrivate::QCallableObject<void (Konsole::Session::*)(int, QProcess::ExitStatus), QtPrivate::List<int, QProcess::ExitStatus>, void>::impl (which=1, this_=0x555555a3e2f0, r=0x55555572cf50, a=0x7fffffffd350, ret=0x0)
    at /home/apol/devel/kde6/include/QtCore/qobjectdefs_impl.h:520
* 5  0x00007ffff3fbc525 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffd350, r=0x55555572cf50, this=0x555555a3e2f0) at /home/apol/devel/frameworks/qt6/qtbase/src/corelib/kernel/qobjectdefs_impl.h:433
* 6  doActivate<false> (sender=sender@entry=0x555555a888e0, signal_index=<optimized out>, argv=<optimized out>, argv@entry=0x7fffffffd350) at /home/apol/devel/frameworks/qt6/qtbase/src/corelib/kernel/qobject.cpp:4021
* 7  0x00007ffff3fb277b in QMetaObject::activate (sender=sender@entry=0x555555a888e0, m=m@entry=0x7ffff41ce300 <QProcess::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffffffd350)
    at /home/apol/devel/frameworks/qt6/qtbase/src/corelib/kernel/qobject.cpp:4081
* 8  0x00007ffff4124c3a in QProcess::finished (this=this@entry=0x555555a888e0, _t1=<optimized out>, _t2=<optimized out>) at /home/apol/build-devel/qt6/qtbase/src/corelib/Core_autogen/include/moc_qprocess.cpp:503
```
2023-10-04 13:50:26 +00:00
Luis Javier Merino Morán
0597073a4e Account for CJK wide chars in copyLineToStream
Otherwise, block selection may not correctly insert spaces/newlines
between lines, since it may obtain only the leftmost character of a CJK
character pair, and put the space in the next character, which will then
be ignored by PlainTextDecoder as if it was the right dummy character of
a CJK character pair.
2023-10-04 13:45:16 +00:00
Luis Javier Merino Morán
7a96fa0a35 Add test case for block selection of CJK chars 2023-10-04 13:45:16 +00:00
Luis Javier Merino Morán
8fc924849a Don't select half a CJK character
This was a visual regression.  Code using the selection already takes
care of dealing with CJK wide characters (mostly), and the old rendering
in TerminalPainter also did.  The new rendering is split in several
layers, which need to know about the selection to use the proper
background and foreground colors, but don't necessarily need to know
about characters, and this caused the regression.

To prevent trouble, we now take care of CJK wide characters before
rendering, when obtaining the characters from the model (Screen), where
characters are marked as selected if they fall into the selection
coordinates.

BUG: 474055
2023-10-04 13:45:16 +00:00
Nate Graham
937a498ec1 KF6: Use new KWindowConfig API to determine whether geometry was saved
See https://invent.kde.org/frameworks/kconfig/-/merge_requests/213 which
adds the needed API to KConfig for us to use here.
2023-09-25 16:14:56 -06:00
Kurt Hindenburg
6ae6f53f71 Fix build on macos 2023-09-14 19:07:35 -04:00
Theodore Wang
f1b0822dec Fixes LinuxProcessInfo::readProcessName
Treats the last ')' in the contents of /proc/[pid]/stat as the
character after the last character of the process name.
2023-09-14 19:58:30 +00:00
l10n daemon script
0c3503502d 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-09-12 01:39:15 +00:00
Theodore Wang
25f8ebf9b6 Periodically check and update ProcessInfo::_name
Currently, there is an issue where 'exec [program]' results in tab
titles not being updated and not showing the process name as [program].
This is probably due to how 'exec' does not result in any change in
pid and simply replaces the current process image with a different one.

Due to a lack of pid changes, Session::updateSessionProcessInfo will not
call ProcessInfo::newInstance, thus not updating the ProcessInfo::_name.

This new change periodically checks and updates the _name of ProcessInfo
through ProcessInfo::readProcessName, which is called by
ProcessInfo::update.

BUG: 391128
2023-09-10 13:14:34 +00:00