Commit Graph

5745 Commits

Author SHA1 Message Date
Magno Lomardo
d3fa26f65b Add the context menu options to split the view left-right and top-bottom
FEATURE: 415724
2023-03-06 22:41:41 +00:00
Waqar Ahmed
c0fd48e950 Fix crash when detaching tab on windows 2023-03-02 09:19:05 +00:00
Matan Ziv-Av
ea4933d63b Use QMediaPlayer::setSourceDevice() for Qt6, rather than setSource()
Requires also using sourceDevice(), instead of mediaStream().
2023-02-26 14:25:05 +00:00
Matan Ziv-Av
534800e056 Use QBuffer instead of a temporary file for media 2023-02-26 14:25:05 +00:00
Matan Ziv-Av
8bc874236e Use QMediaPlayer::setSource() instead of setMedia() in Qt6. 2023-02-26 14:25:05 +00:00
Matan Ziv-Av
752a8b2f81 Add inlineMedia parameter to OSC 1337 File= to support audio files 2023-02-26 14:25:05 +00:00
Matan Ziv-Av
3f3bfa7114 In OSC 1337 inline defaults to false
Without this, missing inline parameter was interpreted as true.
Also cleanup other boolean parameters.
2023-02-26 14:25:05 +00:00
Matan Ziv-Av
60a534a2e7 codecNameTrigger's parameter is a QString, not QByteArray. 2023-02-26 12:28:35 +00:00
Matan Ziv-Av
0717268d03 Fix a typo in e98a6a19ff
the cases for version >= 5.103 and < 5.103 are reversed
2023-02-26 12:28:35 +00:00
Nate Graham
9acc879b64 Make wasWindowGeometrySaved() function consider new key format
The key format is changing in
https://invent.kde.org/frameworks/kconfig/-/merge_requests/184; take
that into account here.

Currently this function copies code from KWindowConfig, which is not
ideal; a more robust solution would be to expose the config file key
value publicly using a function in KWindowConfig that Konsole can call.
That's KF6 material, though, so for now, let's fix this issue by simply
supporting the new key format as well as the old one.
2023-02-26 00:23:12 +00:00
Kurt Hindenburg
6961e4c1a6 Give layout unique name 2023-02-23 20:22:06 -05:00
Kurt Hindenburg
6cb5e43473 Fix comment spelling 2023-02-23 20:21:53 -05:00
Nicolas Fella
e98a6a19ff Port away from deprecated KCodecAction API 2023-02-24 01:05:24 +00:00
Matan Ziv-Av
feb44c226f Make behaviour of characters with problematic width configurable
Add a profile option to follow Unicode standard for the display width of
characters, where this width differs from glibc's wcwidth.

Currently the only character affected by this is soft hyphen (unicode 0x00ad).

Konsole generally follows wcwidth() function when determining the display
width of characters, since this is behaviour expected by libreadline, and
doing otherwise corrupts lines containing problematic characters. When such
characters are used more for display, then on the command line, following
the Unicode standard may be prefferable.

The default for this option is disabled - that is follow wcwidth().

CCBUG: 464823
2023-02-24 00:46:34 +00:00
Matan Ziv-Av
7f6f2c1cea Make keyboard selection mode independent of read only mode 2023-02-24 00:18:16 +00:00
Matan Ziv-Av
0375b56d74 Allow pressing Esc to quit keyboard selection mode 2023-02-24 00:18:16 +00:00
Waqar Ahmed
d7706fab23 KonsoleDecoders: Remove konsolecolorscheme dependency 2023-02-23 23:53:26 +00:00
Waqar Ahmed
ae1b05e629 Fix ASAN build failure with 2023-02-23 23:53:26 +00:00
Waqar Ahmed
0a78bfe4ac Fix inconsistent dll linkage errors and warnings on windows 2023-02-23 23:53:26 +00:00
Celeste Wouters
e16ccb408b Clamp TerminalDisplay size to prevent buffer overflow crash
Konsole's code base uses a MAX_LINE_WIDTH define, currently set to 1024,
to act as sizes for various buffers used with ICU text shaping
algorithms, but no range checks are ever performed on those, meaning
that a display area of more than 1023 character cells wide will overflow
said buffers.

This can happen if you have a very large display, a small font size, or,
egregiously, if you disconnect all displays when running under a Wayland
compositor, prompting qt.qpa.wayland to create a fake screen of
potentially huge size.

This commit takes the easy way out by clamping the TerminalDisplay size
to MAX_LINE_WIDTH-1, which is large enough for most users (1023), and
better than crashing due to buffer overflows anyway.
2023-02-21 18:03:58 +00:00
arti amilots
b138d1ec7c Add a more useful error popup to hint user when no quick commands or ssh config is available.
Fixes BUG: 464995
2023-02-20 19:56:45 +00:00
Waqar Ahmed
59a7626add Make konsole cmake configurable on windows 2023-02-20 12:26:05 +05:00
Nicolas Fella
11231f7b02 Port away from deprecated KWindowSystem API
And better separate X11-specific parts
2023-02-15 22:45:14 +00:00
Nicolas Fella
599d44b5bf Port away from deprecated KWindowSystem::compositingActive 2023-02-15 22:45:14 +00:00
Nicolas Fella
4137f62f0b Properly sort includes 2023-02-15 22:45:14 +00:00
Nicolas Fella
3d34c0aa11 Simplify part demo
Assume that compositing is enabled

It's almost always the case anyway
2023-02-15 22:45:14 +00:00
Waqar Ahmed
c6d9bf6c1f Clean up cmake, remove uneeded EXPORTs
- Remove duplicate entries in cmake file
- Remove not needed EXPORT macros
- Move WindowSystemInfo.cpp to konsoleprivate instead of duplicating it
  which is incorrect

I tried to start porting konsole on windows but there are too many
issues. These are fixes for some of the things I noticed
2023-02-15 22:06:44 +00:00
l10n daemon script
32517acb16 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-02-15 02:07:20 +00:00
Dāvis Mosāns
5f632663e5 Screen: Fix copyLineToStream Qt6 assert
Qt6 added assert for qBound when min > max.

lineLength can be 0 in which case start always must be 0
2023-02-11 09:23:13 +00:00
Dāvis Mosāns
fc82d52ae1 Screen: Fix copyLineToStream Qt6 assert
Qt6 added assert for qBound when min > max.
This can happen if you try to select text that's after whitespace
because then length will be before start causing negative max.
2023-02-11 09:23:13 +00:00
Alexander Lohnau
85edef9377 Clean up preparetips leftover in Messages.sh 2023-02-10 20:12:18 +01:00
Andreas Hartmetz
aaf8135dba Use manhattanLength instead of dotProduct to measure distance
This style is probably more obvious to people whose last maths
course was a long time ago.
2023-02-08 21:49:40 +01:00
Matan Ziv-Av
3184172405 Stop waiting for a triple click if the pointer moved too far. 2023-02-08 15:56:28 +00:00
Andreas Hartmetz
d88d6c219d Rework triple click multi paste avoidance
This fixes a memory leak and, frankly, speculative cases where
double-click selected text that shouldn't be copied, is copied.
- don't leak QMimeData in case it isn't eventually submitted to
  the clipboard - don't even create it
- get rid of the separate flag for pending double-click copy text,
  just check if the paste text is empty
- Consolidate the two QTimers started after a double click. QTimer
  has some guarantees about order of starting and order of
  triggering of timers, but it's more obvious to just do things
  from one timer. Also slightly more efficient.
- Always cancel double-click paste if any other paste happens
  before the timeout - add code to that effect in the most generic
  copying code paths. I'm not quite sure if all possible cases
  work correctly now. Many things can happen with all the
  selection modes supported + all the possible user input events.
2023-02-08 15:56:28 +00:00
Matan Ziv-Av
dc52637988 Handle losing focus while waiting for triple click
If focus is lost while waiting for a triple click,
a triple click is not possible any more.
2023-02-08 15:56:28 +00:00
Matan Ziv-Av
9d5a93cd09 Handle another potential triple click case
If a middle button click is pressed while waiting for a triple click,
the word selected by double click needs to be copied to the buffer before
pasting.
2023-02-08 15:56:28 +00:00
Matan Ziv-Av
b238fb29cf Fix bug in double-click selection
A bug introduced in 0752cf3d prevents copying selection to clipboard if
a key is pressed a short time after a double click. This is avoided by:
- Do not exit selection mode in the time interval between a double click
  and a (potential) third click.
- Save the selection text on a double click, and copy the saved text,
  rather than the current selection if no third click at the end of the
  triple click interval.

BUG: 463268
2023-02-08 15:56:28 +00:00
l10n daemon script
6e734d4fdc 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-02-07 02:05:36 +00:00
Matan Ziv-Av
a26db113b9 temp 2023-01-27 18:07:35 +02:00
Matan Ziv-Av
880793f9f4 When splitting view from the next tab, keep the current focused session 2023-01-27 18:07:35 +02:00
Matan Ziv-Av
b9ab961bad Add actions to split view without creating a new session
Split horizontal/vertical/auto from next tab acts like the usual split view
but takes the first session of the next tab, instead of creating a new
session. This allows for merging two separate tabs into a single tab.
2023-01-27 18:07:35 +02:00
Matan Ziv-Av
61d243aa31 Update blinking cursor in its correct visual position
The function to update the cursor when it blinks off has to update the
display according to visual cursor positions. Before 22.12, the cursor's
visual position was always identical to its logical, but now it may differ
when its inside an RTL string.

When painting the cursor, its visual position is known, so save it for
using in updateCursor().
2023-01-23 22:59:39 +00:00
Matan Ziv-Av
69febe69e9 If paragraph direction maybe RtL, don't omit spaces at end of line.
After reordering they might not be at the end.
2023-01-23 22:59:39 +00:00
Matan Ziv-Av
d0d1dcda81 When the cursor is blinking and off, do not reverse text color
BUG: 463911
2023-01-23 21:55:54 +00:00
Weng Xuetian
0fe5d5bba3 Revamp the inputMethodQuery for konsolepart.
1. Surrounding text does not make sense for terminal, because
   surrounding text is used by input method for text predication, usually
   used together with deleteSurroundingText (commitString with negative
   offset), which is impossible for terminal application because it
   requires directly modify the buffer. Return value for surrounding
   text may cause invalid expectation from input method, e.g. input
   method may wrongly treat the command prompt as a part of text in the
   text buffer.
2. Fallback inputMethodQuery to QWidget default implementation, this
   allows ImHint to use QWidget::inputMethodHints().
3. Set default input method hints that makes sense for terminal.
2023-01-14 19:32:44 +00:00
Matan Ziv-Av
a991d8d9a4 When pasting from clipboard, check data is non null before dereferencing
QClipboard::mimeData may return nullptr.

BUG: 463683
2023-01-09 15:57:33 +00:00
l10n daemon script
0649cbea2c 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-01-08 02:04:27 +00:00
Luis Javier Merino Morán
509bb97063 Recover comment lost in refactoring
Lost in commit 68ab8f55b, which split TerminalPainter from
TerminalDisplay.
2023-01-06 19:16:07 +00:00
Luis Javier Merino Morán
56a02a17ed Fractional scaling and Antialias don't mix well
This is bug #373232 again.  The rendering rewrite in 76f879cd7 reenabled
antialasing in a too wide context, causing the bug to reappear.

After #373232, the situation was that QPainter::TextAntialiasing instead
of QPainter::Antialiasing would be enabled depending on the "Smooth
fonts" setting, and QPainter::Antialiasing would be enabled depending on
that same setting just for TerminalPainter::drawLineCharString().  Go
back to that situation.

BUG: 462914
2023-01-06 19:16:07 +00:00
l10n daemon script
bc555af4f7 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-01-04 02:07:23 +00:00