Fix URLs, add konsole.patch to repo

This commit is contained in:
Anthony Wang 2023-09-14 16:51:07 -04:00
parent a562d5fdab
commit 5dc1c631ac
Signed by: a
SSH key fingerprint: SHA256:B5ADfMCqd2M7d/jtXDoihAV/yfXOAbWWri9+GdCN4hQ
3 changed files with 70 additions and 9 deletions

View file

@ -1,7 +1,7 @@
pkgbase = konsole-osc52
pkgdesc = KDE terminal emulator patched with OSC52 copy support
pkgver = 23.08.1
pkgrel = 1
pkgrel = 2
url = https://apps.kde.org/konsole/
arch = x86_64
groups = kde-applications
@ -16,9 +16,10 @@ pkgbase = konsole-osc52
depends = kparts
depends = knewstuff
optdepends = keditbookmarks: to manage bookmarks
provides = konsole
conflicts = konsole
source = https://download.kde.org/stable/release-service/23.08.1/src/konsole-osc52-23.08.1.tar.xz
source = https://download.kde.org/stable/release-service/23.08.1/src/konsole-osc52-23.08.1.tar.xz.sig
source = https://download.kde.org/stable/release-service/23.08.1/src/konsole-23.08.1.tar.xz
source = https://download.kde.org/stable/release-service/23.08.1/src/konsole-23.08.1.tar.xz.sig
source = https://git.exozy.me/exozyme/exozyme/raw/branch/main/src/konsole.patch
validpgpkeys = CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7
validpgpkeys = F23275E4BF10AFC1DF6914A6DBD2CE893E2D1C87

View file

@ -3,9 +3,10 @@
# Contributor: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
pkgname=konsole-osc52
_pkgname=konsole
pkgname=$_pkgname-osc52
pkgver=23.08.1
pkgrel=1
pkgrel=2
arch=(x86_64)
url='https://apps.kde.org/konsole/'
pkgdesc='KDE terminal emulator patched with OSC52 copy support'
@ -14,8 +15,10 @@ groups=(kde-applications kde-utilities)
depends=(knotifyconfig kpty kparts knewstuff)
makedepends=(extra-cmake-modules kdoctools)
optdepends=('keditbookmarks: to manage bookmarks')
conflicts=(konsole)
source=(https://download.kde.org/stable/release-service/$pkgver/src/$pkgname-$pkgver.tar.xz{,.sig} https://git.exozy.me/exozyme/exozyme/raw/branch/main/src/konsole.patch)
provides=($_pkgname)
conflicts=($_pkgname)
source=(https://download.kde.org/stable/release-service/$pkgver/src/$_pkgname-$pkgver.tar.xz{,.sig}
$_pkgname.patch)
sha256sums=('1ea81c62e150243ba178463418e6caf01bcca5bded37992b8a1bd87dffca1f4c'
'SKIP'
'e7c2ca3b30e018139a139e99141202a2efc8e4e880e2965b09537f9a97865e53')
@ -24,11 +27,11 @@ validpgpkeys=(CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7 # Albert Astals Cid <aac
D81C0CB38EB725EF6691C385BB463350D6EF31EF) # Heiko Becker <heiko.becker@kde.org>
prepare() {
patch -d $pkgname-$pkgver -p1 < konsole.patch
patch -d $_pkgname-$pkgver -p1 < $_pkgname.patch
}
build() {
cmake -B build -S $pkgname-$pkgver \
cmake -B build -S $_pkgname-$pkgver \
-DBUILD_TESTING=OFF
cmake --build build
}

57
konsole.patch Normal file
View file

@ -0,0 +1,57 @@
diff --git a/src/Vt102Emulation.cpp b/src/Vt102Emulation.cpp
index bebd5e399..a434ee4ab 100644
--- a/src/Vt102Emulation.cpp
+++ b/src/Vt102Emulation.cpp
@@ -12,7 +12,9 @@
#include <cstdio>
// Qt
+#include <QApplication>
#include <QBuffer>
+#include <QClipboard>
#include <QEvent>
#include <QKeyEvent>
#include <QTimer>
@@ -1147,6 +1149,29 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
connect(notification, &KNotification::defaultActivated, this, [this, notification]() {
_currentScreen->currentTerminalDisplay()->notificationClicked(notification->xdgActivationToken());
});
+ }
+ if (attribute == 52) {
+ // Clipboard
+ QStringList params = value.split(QLatin1Char(';'));
+ if (params.length() == 0) {
+ return;
+ }
+
+ QClipboard::Mode mode;
+ if (params[0] == QLatin1Char('c')) {
+ mode = QClipboard::Clipboard;
+ } else if (params[0] == QLatin1Char('p')) {
+ mode = QClipboard::Selection;
+ } else {
+ return;
+ }
+
+ if (params.length() == 2) {
+ // Copy to clipboard
+ QApplication::clipboard()->setText(QString::fromUtf8(QByteArray::fromBase64(params[1].toUtf8())), mode);
+ } else {
+ QApplication::clipboard()->clear(mode);
+ }
return;
}
diff --git a/src/Vt102Emulation.h b/src/Vt102Emulation.h
index 3e067549a..a34bfc590 100644
--- a/src/Vt102Emulation.h
+++ b/src/Vt102Emulation.h
@@ -124,7 +124,7 @@ private:
void resetModes();
void resetTokenizer();
-#define MAX_TOKEN_LENGTH 256 // Max length of tokens (e.g. window title)
+#define MAX_TOKEN_LENGTH 65536 // Max length of tokens (e.g. window title)
void addToCurrentToken(uint cc);
int tokenBufferPos;