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:
This commit is contained in:
Sune Vuorela
2025-11-26 17:22:08 +00:00
committed by Kurt Hindenburg
parent 33d0fa3b32
commit 8ed45adea0
3 changed files with 152 additions and 135 deletions

View File

@@ -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?

View File

@@ -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,37 +53,17 @@
</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>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="kcfg_SearchRegExpression">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Match using regular expressions</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="kcfg_RemoveWindowTitleBarAndFrame">
<property name="text">
<string>Remove window titlebar and frame</string>
<string>Focus terminals when the mouse pointer is moved over them</string>
</property>
</widget>
</item>
@@ -100,121 +80,21 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="kcfg_UseSingleInstance">
<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>
<item row="9" column="0" alignment="Qt::AlignmentFlag::AlignRight">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Run all Konsole windows in a single process</string>
<string comment="@item:intext Search options">Search:</string>
</property>
</widget>
</item>
<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>
<item row="4" column="1">
<widget class="QCheckBox" name="kcfg_RemoveWindowTitleBarAndFrame">
<property name="text">
<string>Remember window size</string>
<string>Remove window titlebar and frame</string>
</property>
</widget>
</item>
<item row="14" column="0" alignment="Qt::AlignmentFlag::AlignRight">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Notifications:</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QCheckBox" name="kcfg_SearchNoWrap">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Sets whether search should stop instead of wrapping</string>
</property>
<property name="text">
<string>No wrap</string>
</property>
</widget>
</item>
<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="text">
<string>Show window title on the titlebar</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="kcfg_FocusFollowsMouse">
<property name="text">
<string>Focus terminals when the mouse pointer is moved over them</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="kcfg_SearchCaseSensitive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Sets whether the search is case sensitive</string>
</property>
<property name="text">
<string>Case sensitive</string>
</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">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Highlight all matches</string>
</property>
</widget>
</item>
<item row="14" column="1">
<item row="15" column="1">
<layout class="QHBoxLayout" stretch="0,1">
<property name="spacing">
<number>0</number>
@@ -250,7 +130,49 @@
</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>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Highlight all matches</string>
</property>
</widget>
</item>
<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="text">
<string>Show window title on the titlebar</string>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QCheckBox" name="kcfg_SearchNoWrap">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Sets whether search should stop instead of wrapping</string>
</property>
<property name="text">
<string>No wrap</string>
</property>
</widget>
</item>
<item row="14" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
@@ -266,7 +188,56 @@
</property>
</spacer>
</item>
<item row="7" column="1">
<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="1" column="1">
<widget class="QCheckBox" name="kcfg_UseSingleInstance">
<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>
</property>
</widget>
</item>
<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>Remember window size</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="kcfg_EnableSecuritySensitiveDBusAPI">
<property name="text">
<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>
@@ -282,6 +253,42 @@
</property>
</spacer>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="kcfg_SearchCaseSensitive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Sets whether the search is case sensitive</string>
</property>
<property name="text">
<string>Case sensitive</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="kcfg_SearchRegExpression">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Match using regular expressions</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="kcfg_ListenForZModemTerminalCodes">
<property name="text">
<string>Listen for ZModem terminal codes</string>
</property>
</widget>
</item>
</layout>
</item>
<item>

View File

@@ -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">