[utilities/konsole] src: Add option to ignore ZModem terminal codes
Kurt Hindenburg
null at kde.org
Wed Nov 26 17:22:09 GMT 2025
Git commit 8ed45adea01f287ecdd0ddd2ee98cd643553c467 by Kurt Hindenburg, on behalf of Sune Vuorela.
Committed on 26/11/2025 at 17:22.
Pushed by hindenburg into branch 'master'.
Add option to ignore ZModem terminal codes
It is sufficiently a rarity that it is more likely that people get
confused by unexpected zmodem terminal codes than the handful of users actually expecting them.
See also: https://bugs.debian.org/1119976
GUI:
M +5 -0 src/Emulation.cpp
M +120 -113 src/settings/GeneralSettings.ui
M +5 -0 src/settings/konsole.kcfg
https://invent.kde.org/utilities/konsole/-/commit/8ed45adea01f287ecdd0ddd2ee98cd643553c467
diff --git a/src/Emulation.cpp b/src/Emulation.cpp
index e3c896752a..fb2737d55e 100644
--- a/src/Emulation.cpp
+++ b/src/Emulation.cpp
@@ -13,6 +13,7 @@
#include <QKeyEvent>
// Konsole
+#include "KonsoleSettings.h"
#include "Screen.h"
#include "ScreenWindow.h"
#include "keyboardtranslator/KeyboardTranslator.h"
@@ -246,6 +247,10 @@ void Emulation::receiveData(const char *text, int length)
const QVector<uint> chars = readString.toUcs4();
receiveChars(chars);
+ if (KonsoleSettings::listenForZModemTerminalCodes() == false) {
+ return;
+ }
+
// look for z-modem indicator
//-- someone who understands more about z-modems that I do may be able to move
// this check into the above for loop?
diff --git a/src/settings/GeneralSettings.ui b/src/settings/GeneralSettings.ui
index 5492412b25..0a6002c92b 100644
--- a/src/settings/GeneralSettings.ui
+++ b/src/settings/GeneralSettings.ui
@@ -37,7 +37,7 @@
<property name="spacing">
<number>6</number>
</property>
- <item row="11" column="1">
+ <item row="12" column="1">
<widget class="QCheckBox" name="kcfg_SearchReverseSearch">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -53,22 +53,22 @@
</property>
</widget>
</item>
- <item row="6" column="1">
- <widget class="QCheckBox" name="kcfg_EnableSecuritySensitiveDBusAPI">
+ <item row="15" column="0" alignment="Qt::AlignmentFlag::AlignRight">
+ <widget class="QLabel" name="label_3">
<property name="text">
- <string>Enable the security sensitive parts of the DBus API</string>
+ <string>Notifications:</string>
</property>
</widget>
</item>
- <item row="8" column="0" alignment="Qt::AlignmentFlag::AlignRight">
- <widget class="QLabel" name="label_2">
+ <item row="5" column="1">
+ <widget class="QCheckBox" name="kcfg_FocusFollowsMouse">
<property name="text">
- <string comment="@item:intext Search options">Search:</string>
+ <string>Focus terminals when the mouse pointer is moved over them</string>
</property>
</widget>
</item>
- <item row="9" column="1">
- <widget class="QCheckBox" name="kcfg_SearchRegExpression">
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="kcfg_AllowMenuAccelerators">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -76,7 +76,14 @@
</sizepolicy>
</property>
<property name="text">
- <string>Match using regular expressions</string>
+ <string>Enable menu accelerators</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="0" alignment="Qt::AlignmentFlag::AlignRight">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string comment="@item:intext Search options">Search:</string>
</property>
</widget>
</item>
@@ -87,8 +94,44 @@
</property>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QCheckBox" name="kcfg_AllowMenuAccelerators">
+ <item row="15" column="1">
+ <layout class="QHBoxLayout" stretch="0,1">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QPushButton" name="enableAllMessagesButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>All dialogs will be shown again</string>
+ </property>
+ <property name="text">
+ <string>Enable all "Don't Ask Again" messages</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation">
+ <enum>Qt::Orientation::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="11" column="1">
+ <widget class="QCheckBox" name="kcfg_SearchHighlightMatches">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -96,28 +139,25 @@
</sizepolicy>
</property>
<property name="text">
- <string>Enable menu accelerators</string>
+ <string>Highlight all matches</string>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="kcfg_UseSingleInstance">
+ <item row="3" column="1">
+ <widget class="QCheckBox" name="kcfg_ShowWindowTitleOnTitleBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="toolTip">
- <string>When launching Konsole re-use existing process if possible</string>
- </property>
<property name="text">
- <string>Run all Konsole windows in a single process</string>
+ <string>Show window title on the titlebar</string>
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QCheckBox" name="kcfg_RememberWindowSize">
+ <item row="13" column="1">
+ <widget class="QCheckBox" name="kcfg_SearchNoWrap">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -125,22 +165,41 @@
</sizepolicy>
</property>
<property name="toolTip">
- <string>If enabled, profile settings will be ignored</string>
+ <string>Sets whether search should stop instead of wrapping</string>
</property>
<property name="text">
- <string>Remember window size</string>
+ <string>No wrap</string>
</property>
</widget>
</item>
- <item row="14" column="0" alignment="Qt::AlignmentFlag::AlignRight">
- <widget class="QLabel" name="label_3">
+ <item row="14" column="1">
+ <spacer>
+ <property name="orientation">
+ <enum>Qt::Orientation::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Policy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
<property name="text">
- <string>Notifications:</string>
+ <string>Process and window:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="12" column="1">
- <widget class="QCheckBox" name="kcfg_SearchNoWrap">
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="kcfg_UseSingleInstance">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -148,34 +207,53 @@
</sizepolicy>
</property>
<property name="toolTip">
- <string>Sets whether search should stop instead of wrapping</string>
+ <string>When launching Konsole re-use existing process if possible</string>
</property>
<property name="text">
- <string>No wrap</string>
+ <string>Run all Konsole windows in a single process</string>
</property>
</widget>
</item>
- <item row="3" column="1">
- <widget class="QCheckBox" name="kcfg_ShowWindowTitleOnTitleBar">
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="kcfg_RememberWindowSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip">
+ <string>If enabled, profile settings will be ignored</string>
+ </property>
<property name="text">
- <string>Show window title on the titlebar</string>
+ <string>Remember window size</string>
</property>
</widget>
</item>
- <item row="5" column="1">
- <widget class="QCheckBox" name="kcfg_FocusFollowsMouse">
+ <item row="6" column="1">
+ <widget class="QCheckBox" name="kcfg_EnableSecuritySensitiveDBusAPI">
<property name="text">
- <string>Focus terminals when the mouse pointer is moved over them</string>
+ <string>Enable the security sensitive parts of the DBus API</string>
</property>
</widget>
</item>
<item row="8" column="1">
+ <spacer>
+ <property name="orientation">
+ <enum>Qt::Orientation::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Policy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="9" column="1">
<widget class="QCheckBox" name="kcfg_SearchCaseSensitive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -191,18 +269,8 @@
</property>
</widget>
</item>
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Process and window:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
- </property>
- </widget>
- </item>
<item row="10" column="1">
- <widget class="QCheckBox" name="kcfg_SearchHighlightMatches">
+ <widget class="QCheckBox" name="kcfg_SearchRegExpression">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -210,77 +278,16 @@
</sizepolicy>
</property>
<property name="text">
- <string>Highlight all matches</string>
+ <string>Match using regular expressions</string>
</property>
</widget>
</item>
- <item row="14" column="1">
- <layout class="QHBoxLayout" stretch="0,1">
- <property name="spacing">
- <number>0</number>
- </property>
- <item>
- <widget class="QPushButton" name="enableAllMessagesButton">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip">
- <string>All dialogs will be shown again</string>
- </property>
- <property name="text">
- <string>Enable all "Don't Ask Again" messages</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Orientation::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="13" column="1">
- <spacer>
- <property name="orientation">
- <enum>Qt::Orientation::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Policy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </item>
<item row="7" column="1">
- <spacer>
- <property name="orientation">
- <enum>Qt::Orientation::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Policy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>16</height>
- </size>
+ <widget class="QCheckBox" name="kcfg_ListenForZModemTerminalCodes">
+ <property name="text">
+ <string>Listen for ZModem terminal codes</string>
</property>
- </spacer>
+ </widget>
</item>
</layout>
</item>
diff --git a/src/settings/konsole.kcfg b/src/settings/konsole.kcfg
index 42fbfd01c6..7fdd0bb81f 100644
--- a/src/settings/konsole.kcfg
+++ b/src/settings/konsole.kcfg
@@ -38,6 +38,11 @@
<tooltip>DBus API like runCommand will be enabled</tooltip>
<default>false</default>
</entry>
+ <entry name="ListenForZModemTerminalCodes" type="Bool">
+ <label>Listen for ZModem Terminal codes</label>
+ <tooltip>Automatic send/receive files over serial connections</tooltip>
+ <default>false</default>
+ </entry>
</group>
<group name="ThumbnailsSettings">
<entry name="EnableThumbnails" type="Bool">
More information about the kde-doc-english
mailing list