From cd791dc80bdc5760502b73c669b06a21df7a2868 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sun, 25 Oct 2026 10:46:11 +1300 Subject: [PATCH 1/3] Fix a comment --- kermit/k95/ckoco3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kermit/k95/ckoco3.c b/kermit/k95/ckoco3.c index 1f188ef39..6ce36fb69 100644 --- a/kermit/k95/ckoco3.c +++ b/kermit/k95/ckoco3.c @@ -17130,8 +17130,8 @@ dodcs( void ) * tt_type_mode >= TT_VT320 && tt_type_mode <= TT_WY370 * Compared to ISVT320() this excludes TT_97801 and TT_AAA. I have no idea * what those terminals implement or if there was any particular reason for - * their exclusion, but excluding TT_VT220 was almost certainly by accient - * as it *does* support at least one DCS sequence here - DECUDK. + * their exclusion, but excluding TT_VT220 was almost certainly by accident + * as it *does* support at least two DCS sequence here - DECUDK and DECDLD. * So now we allow ISVT320() in here, plus TT_VT220 and a few others, but * exclude TT_97801 and TT_AAA as before just in case there was some * particular reason for their exclusion. From a5816ae7fb02dfec801f32529797224c583b80f2 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 26 Oct 2026 16:13:05 +1300 Subject: [PATCH 2/3] New command to lock/unlock key definitions. The setting itself already existed in Kermit 95 but no command was provided to control it. It could only be set to ON via DECUDK. Unlike on real terminals, the user had no ability to reset it back to OFF. The new command gives the user control over this setting. The setting has also been extended to affect DECUDL-equivalent functions in other emulations in the interests of security. And in the interests of security this setting now defaults to ON in order to prevent the host from making unexpected changes to the keymap. --- doc/changes.md | 13 ++++++++++++- doc/manual/setterm.html | 11 +++++++++++ kermit/k95/ckoco3.c | 4 ++-- kermit/k95/ckohp.c | 6 ++++++ kermit/k95/ckotvi.c | 3 +++ kermit/k95/ckowys.c | 9 +++++++++ kermit/k95/ckuus2.c | 10 ++++++++++ kermit/k95/ckuus7.c | 12 ++++++++++++ kermit/k95/ckuusr.h | 1 + 9 files changed, 66 insertions(+), 3 deletions(-) diff --git a/doc/changes.md b/doc/changes.md index 0b7222414..578adc3d9 100644 --- a/doc/changes.md +++ b/doc/changes.md @@ -10,7 +10,7 @@ log living in the [Whats New in 3.0](whats-new.md) document. When the final release of v3.0 eventually happens, the details about the various v3.0 eventually be moved elsewhere, with the full v3.0 change log taking their place. -## Kermit 95 v3.0 beta 8 - Date TBD, likely mid-2026 +## Kermit 95 v3.0 beta 8 - Date TBD, likely late-2026/early-2027 This release comes with *significant* changes to the way Kermit 95 handles color. While every effort has been made to ensure there are no unexpected @@ -40,6 +40,14 @@ def tt_linux { } ``` +### Host Programmable Key Definitions Now Locked by Default +The ability for the host to modify Kermit 95s keymap via functions such as User +Defined Keys in DEC VT emulations, and equivalents in other emulations is now +disabled by default in the interests of improving security. + +If you have a host application that relies on this feature, use the command +`SET TERM LOCk-KEY-DEFINITIONS OFF`. + ### A New Terminal Type: K95 This release of Kermit 95 includes a new "K95" terminal type which aims for compatibility with modern terminal software expecting something @@ -175,6 +183,9 @@ as part of K95 at this time, the default terminal remains VT220 for now. of UTF-8 mode. This is similar to xterms vt100Graphics resource, and PuTTYs "Enable VT100 line drawing even in UTF-8 mode" setting. It is off by default for all terminal types except k95 and linux. + - New `SET TERMINAL LOCK-KEY-DEFINITIONS` command. When set to ON (the + default), this setting prevents the host from modifying the keymap using + methods such as DECUDK. ### Enhancements - The Control Sequences documentation ([preliminary version available online](https://davidrg.github.io/ckwin/dev/ctlseqs.html)) diff --git a/doc/manual/setterm.html b/doc/manual/setterm.html index 7b44cdaef..82ee60678 100644 --- a/doc/manual/setterm.html +++ b/doc/manual/setterm.html @@ -470,6 +470,17 @@

The SET TERMINAL Command

number tells Kermit 95 add the specified amount of spacing between screen lines. +

+

SET TERMINAL LOCK-KEY-DEFINITIONS { OFF, ON } +
Some terminal emulations allow the host to alter some part of the keymap. As +this can be a security risk, this setting allows you to prevent the keymap from +being altered by the host. You should leave this setting ON unless you know +that your software relies on altering the keymap via functions such as DECUDK. +This setting does not affect changes made to the keymap via the command screen +(eg, SET KEY). You can view the state of this setting via SHOW UDK. +This setting was added in Kermit 95 v3.0. In previous versions key definitions +could only be locked by the host. +

SET TERMINAL LOCKING-SHIFT { OFF, ON }
Tells Kermit 95 whether to send Shift-In/Shift-Out (Ctrl-O and Ctrl-N) to diff --git a/kermit/k95/ckoco3.c b/kermit/k95/ckoco3.c index 6ce36fb69..704fcbceb 100644 --- a/kermit/k95/ckoco3.c +++ b/kermit/k95/ckoco3.c @@ -3362,7 +3362,7 @@ char * ekeys[] = { /* And close to 108 DG keys (regular and unix modes) */ /* 153 SNI 97801 keys */ char * udkfkeys[200]; /* let udkreset() initialize them */ -int udklock = 0 ; /* Are User Defined Keys locked? */ +int udklock = 1 ; /* Are User Defined Keys locked? */ #ifndef NOKVERBS extern struct keytab kverbs[] ; /* Kverbs table */ @@ -29383,7 +29383,7 @@ vtescape( void ) #ifdef CK_APC #ifndef NOSETKEY #ifndef NOKVERBS - if ( next == quote ) + if ( next == quote && !udklock) { /* assign the string to the function key */ if ( udkfkeys[fn] ) { diff --git a/kermit/k95/ckohp.c b/kermit/k95/ckohp.c index b4672415c..10595a154 100644 --- a/kermit/k95/ckohp.c +++ b/kermit/k95/ckohp.c @@ -799,6 +799,7 @@ hpascii( int ch ) char label[80]=""; char string[160]=""; int ch3=0, keyi=0, i=0; /* work variables */ + extern int udklock; do { if ((x = hpparam(&n,&ch3,&y)) < 0) @@ -886,6 +887,8 @@ hpascii( int ch ) if ( debses ) break; + if ( udklock ) + break; if ( use < 0 || use > 2 || use == 1 /* we don't support local mode */) break; @@ -2884,6 +2887,7 @@ hpascii( int ch ) /* set Softkey default values */ char string[3]; int keyi; + extern int udklock; if ( deblog ) { sprintf(debbuf, "ESC %c", ch); @@ -2892,6 +2896,8 @@ hpascii( int ch ) } if ( debses ) break; + if ( udklock ) + break; sprintf(string,"%c%c",ESC,ch); keyi = ch - 'p'; if ( udkfkeys[keyi] ){ diff --git a/kermit/k95/ckotvi.c b/kermit/k95/ckotvi.c index 4676143fa..ad79c6f69 100644 --- a/kermit/k95/ckotvi.c +++ b/kermit/k95/ckotvi.c @@ -620,6 +620,7 @@ tviascii( int ch ) /* Reprogram any individual editing key */ if ( ISTVI950(tt_type_mode) ) { int p1, p2, k=-1; + extern int udklock; if ((p1 = tviinc()) < 0) break; @@ -627,6 +628,8 @@ tviascii( int ch ) break; if ( debses ) break; + if ( udklock ) + break; switch ( p1 ) { case '0': /* Shift Send */ k = K_TVISSEND; diff --git a/kermit/k95/ckowys.c b/kermit/k95/ckowys.c index bf05df711..0862cde66 100644 --- a/kermit/k95/ckowys.c +++ b/kermit/k95/ckowys.c @@ -2356,6 +2356,8 @@ wyseascii( int ch ) break; } else { + extern int udklock; + debug(F110,"Wyse Escape","Assign Key Definition",0); i = 0 ; while ( (keydef[i]=wyinc()) != DEL ) @@ -2364,6 +2366,8 @@ wyseascii( int ch ) if ( debses ) break; + if ( udklock ) + break; if ( key >= '@' && key <= 'O' ) { keyi = key-'@'; } @@ -4578,6 +4582,7 @@ wyseascii( int ch ) break; } else { + extern int udklock; int label = ( (key >= '0' && key <= '7') || (key >= 'P' && key <= '_') ); @@ -4592,6 +4597,10 @@ wyseascii( int ch ) break; } + if ( udklock ) { + break; + } + if ( keydef[0] == '~' ) { /* we only allow redefinition of function keys */ debug(F110,"Wyse Escape","Program key or label tilde",0); diff --git a/kermit/k95/ckuus2.c b/kermit/k95/ckuus2.c index 4823c61d6..c8348ea9d 100644 --- a/kermit/k95/ckuus2.c +++ b/kermit/k95/ckuus2.c @@ -8415,6 +8415,16 @@ static char *hxyterm[] = { " Valid values range from 1.0 to 3.0 inclusive.", " ", #endif /* KUI */ +"SET TERMINAL LOCK-KEY-DEFINITIONS { OFF, ON }", +" Some terminal emulations allow the host to alter some part of the keymap. As", +" this can be a security risk, this setting allows you to prevent the keymap", +" from being altered by the host. You should leave this setting ON unless you", +" know that your software relies on altering the keymap via functions such as", +" DECUDK. This setting does not affect changes made to the keymap via the ", +" command command screen (eg, SET KEY). You can view the state of this setting", +" via SHOW UDK. This setting was added in Kermit 95 v3.0. In previous versions", +" key definitions could only be locked by the host.", +" ", #endif /* OS2 */ #ifndef NOCSETS diff --git a/kermit/k95/ckuus7.c b/kermit/k95/ckuus7.c index c7290f9f7..64d88a966 100644 --- a/kermit/k95/ckuus7.c +++ b/kermit/k95/ckuus7.c @@ -1026,6 +1026,9 @@ static struct keytab trmtab[] = { { "local-character-set", XYTLCS, CM_INV }, #endif /* OS2 */ #endif /* NOCSETS */ +#ifdef OS2 + { "lock-key-definitions", XYTLOCKKEYS, 0 }, +#endif /* OS2 */ { "locking-shift", XYTSO, 0 }, #ifdef OS2 { "margin-bell", XYTMBEL, 0 }, @@ -5111,6 +5114,15 @@ settrm() { return(success = 1); break; + case XYTLOCKKEYS: { /* SET TERMINAL LOCK-KEY-DEFINITIONS */ + y = seton(&x); /* Go parse ON or OFF */ + if (y > 0) { /* Command succeeded? */ + extern int udklock; + udklock = x; + } + return(y); + } + case XYTANS: { /* SET TERMINAL ANSWERBACK */ /* NOTE: We let them enable and disable the answerback sequence, but we diff --git a/kermit/k95/ckuusr.h b/kermit/k95/ckuusr.h index 01ee12d79..a97446164 100644 --- a/kermit/k95/ckuusr.h +++ b/kermit/k95/ckuusr.h @@ -1355,6 +1355,7 @@ struct stringint { /* String and (wide) integer */ #define TTS_SMOOTH_2 2 #define TTS_SMOOTH_4 3 #define XYTVGUTF8 72 /* SET TERM VT-GRAPHICS-IN-UTF8 */ +#define XYTLOCKKEYS 73 /* SET TERM LOCK-KEY-DEFINITIONS */ #endif /* OS2 */ #define XYATTR 34 /* Attribute packets */ From e93d0e12228bad4e345991029b13574cd052a5f5 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 26 Oct 2026 16:20:52 +1300 Subject: [PATCH 3/3] Add a page to the manual describing the VT220 emulation. This covers all the known ways in which Kermit 95s VT220 emulation differs from the real thing. In particular, the freshly added setting to lock key definitions whose default differs from that of a real VT220. --- doc/manual/termtype.html | 2 +- doc/manual/tt_vt220.html | 546 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 547 insertions(+), 1 deletion(-) create mode 100644 doc/manual/tt_vt220.html diff --git a/doc/manual/termtype.html b/doc/manual/termtype.html index 82d44d917..b04b86392 100644 --- a/doc/manual/termtype.html +++ b/doc/manual/termtype.html @@ -225,7 +225,7 @@

Kermit 95 Terminal Types

-

VT220 +
VT220
The industry-standard 8-bit Digital Equipment Corporation VT220 terminal with color extensions. diff --git a/doc/manual/tt_vt220.html b/doc/manual/tt_vt220.html new file mode 100644 index 000000000..c5ca45a07 --- /dev/null +++ b/doc/manual/tt_vt220.html @@ -0,0 +1,546 @@ + + + + Kermit 95 - VT220 Emulation + + +

VT220 Emulation in Kermit 95

+ +

+Kermit 95 includes a fairly comprehensive VT220 emulation including features +rarely implemented by other terminal emulators such as soft character sets +(soft fonts / dynamically redefined character sets) and smooth-scroll. + +

+VT220 is also Kermit 95s default emulation as it is present in most +hosts terminfo database. You can also choose from one of two VT220 emulation +options by selecting either vt220 or vt220pc from the +drop-down list on the toolbar (K95G) or using the SET TERMINAL TYPE +command. + +

Key Map

+

The VT220 and VT220PC terminal types differ only in their default keymap:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PC KeyVT220VT220PC
VT KeyKverbVT KeyKverb
F1Gold\KgoldF1\Kdecf01
F2PF2\Kpf2F2\Kdecf02
F3PF3\Kpf3F3\Kdecf03
F4PF4\Kpf4F4\Kdecf04
F5Break\KbreakF5\Kdecf05
Gray PgUpScroll Up\KupscnPrevious\Kdecprev
Gray PgDownScroll Down\KdnscnNext\Kdecnext
Gray EndScroll Bottom\KendscnFind\Kdecfind
Gray HomeScroll Top\KhomscnHome\Kdechome
Gray InsertInsert\Kdecinsert
+ +

+For more on the keymap used by Kermit 95s VT220 emulation, see: + + Kermit 95 VT220 / VT320 Function Key Mapping + +

Differences in K95s VT220 emulation

+

+Any differences between Kermit 95s VT220 emulation and a real VT220 except for +those noted below are likely a bug. + +

Functionality

+

The following functions are implemented differently in Kermit 95 vs a real VT220:

+
+
132 Column Mode
+
Instead of using a condensed font in 132-column mode, Kermit 95 changes + the window size. +
+
VT100 Confidence Tests (DECTST)
+
Kermit 95 does not implement this function
+
Interlaced Video Mode (DECINLM)
+
Kermit 95 does not implement this mode
+
+ +

Settings

+

VT settings map on to Kermit 95 settings as follows. Note that Kermit 95s +defaults for some settings differ from that of a real VT220, and Kermit 95 lacks +equivalents of some settings. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Set-Up ScreenVT SettingVT220 DefaultK95 DefaultK95 SettingNotes
On Line/LocalOn LineK95 does not implement a Local mode
Clear Displayn/a (action)CLEAR TERMINAL-SCREEN ALL
Clear Commn/a (action) + CLEAR DEVICE-AND-INPUT
+ CLEAR KEYBOARD-BUFFER
+
These commands aren't an exact equivalent. They don't cancel or + reset printing or abort any escape sequences in progress. +
Reset Terminaln/a (action)\KresetUse Reset Terminal from the Actions menu, or enter + \Kreset at the command screen. +
KeyboardNorth American
Display80/132 Columns80 columnsSET TERMINAL WIDTHK95 allows arbitrary widths to be set
Control RepresentationInterpret ControlsK95 does not provide a command for togging this option. +
Auto WrapOffOnSET TERMINAL WRAP
ScrollSmoothJumpSET TERMINAL SCROLL-MODE
Text, ScreenLight Text, Dark ScreenSET TERMINAL COLOR TERMINAL
Text CursorCursorSET TERMINAL CURSOR
Cursor StyleBlockUnderlineSET TERMINAL CURSOR
GeneralModeVT200 Mode, 7-bitVT200 Mode, 8-bit + SET TERMINAL TYPE
+ SET TERMINAL BYTESIZE +
VT100 Mode Terminal IDVT220SET TERMINAL TYPEDedicated VT100, VT101 and VT102 emulations are available
User Defined KeysUnlockedLockedSET TERMINAL LOCK-KEY-DEFINITIONSLocked by default in K95 for security
User FeaturesUnlockedK95 does not support this feature
Character Set ModeNationalSET TERMINAL CHARACTER-SET
KeypadNumericSET TERMINAL KEYPAD-MODE
Cursor KeysNormalSET TERMINAL ARROW-KEYS
New LineNo New LineSET TERMINAL NEWLINE-MODE
CommunicationsTransmit4800SET SPEEDK95 does not allow setting separate transmit/receive speeds
ReceiveTransmit
XOFFXOFF at 64SET FLOW + K95 doesn't support setting when XOFF occurs. RTS/CTS flow control + is also supported. +
Bits8SET TERMINAL BYTESIZEK95 uses the terminal bytesize for serial data bits
ParityNo ParitySET PARITY
Stop Bit1SET STOP-BITS
Local EchoOffSET LOCAL-ECHO
PortEIA port, Data Leads OnlySET LINE
Disconnect, ___ DelayDisconnect, 2s DelayK95 doesn't allow changing the disconnect delay.
______ TransmitLimited TransmitUnlimited TransmitSET OUTPUT PACINGK95 allows setting a per-output-character delay
Printer*Speed4800SET PRINTER /SPEED:
ModeNormalSET TERMINAL PRINT
Bits8K95 does not support this setting
ParityNoneSET PRINTER /PARITY:
Stop Bits1K95 does not support this setting
Print...Full PageK95 does not support this setting
Printed Data TypePrint National OnlySET PRINTER /CHARACTER-SET:
Print TerminatorTerminator = FFNo TerminatorSET PRINTER /END-OF-JOB-STRING:
KeyboardTypewriter/Data Processing KeysTypewriterK95 does not support this setting or the Data Processing Keys option
Caps/Shift LockCaps LockK95 does not support this setting or the Data Processing Keys option
Auto RepeatOnK95 only supports changing this setting via DECARM
KeyclickOnOff\KkeyclickThis setting is available from the Actions menu in K95G, and can be + toggled via the \Kkeyclick Kverb (you can enter it as a + command) +
Margin BellOnOffSET TERMINAL MARGIN-BELL
Warning BellOnSET BELL
BreakOnThe break key can be unmapped with SET KEY
Auto AnswerbackOn
AnswerbackSET TERMINAL ANSWERBACK MESSAGEK95 does not support setting arbitrary answerback messages
Answerback ConcealedK95 does not support this setting
TabClear All Tabs + K95 does not implement commands for manipulating tab stops. Tab + stops can only be manipulated via control sequences. +
Set 8 Column Tabs
Set Tab Stops
+ +* K95 also supports printer connectivity options besides serial. See +Printer Setup and Troubleshooting for more +information on printing options. + +

If you want Kermit 95s VT220 emulation to use similar defaults to a real +VT220, you can put the following in your k95custom.ini so that they run +automatically when the VT220 or VT220PC terminal emulations are chosen. +

+    def tt_vt220 {
+        set terminal wrap off
+        set terminal scroll-mode smooth
+        set terminal color terminal lgray black
+        set terminal cursor full on
+        set terminal bytesize 7
+        set terminal lock-key-definitions off  ; Enable DECUDK - a security risk
+        set terminal sgr-colors off            ; A real VT220 doesn't support color
+    }
+
+    def tt_vt220pc {
+        tt_vt220
+    }
+
+    ; K95s terminal emulator is initialised to VT220 before any startup scripts
+    ; are run, so this is required to ensure tt_vt220 runs on startup.
+    if equal \v(terminal) vt220 tt_vt220
+
+ +

+


+

+ + Click Back on your Browser's Toolbar to return. +

+


+