Repository navigation
Conversation
…ift+F10 mapped to K_UDKF1...K_UDKF10 by default for the K95 terminal type. And for compatibility with xterm, UDKs are now initialised to what xterm sends for the K95 type.
…ccur on hard reset.
|
@j4james I hope this should fix the outstanding (known) issues with UDKs in the K95 terminal type! |
|
@davidrg If you're interested in looking into other UDK issues at the same time, these are a few edge cases that showed up in my conformance tests:
Those are just the failed test case names that come from the logs, so I'm not sure how useful they are to you without more context - I'm afraid the system isn't very well suited for bug reporting. But if any of those sound like issues you want to address, just let me know and I can try and provide you with more detailed test cases. |
|
Some feedback regarding this PR in particular:
|
|
I'm not too surprised there are other things not quite right with DECUDK - seems like whenever look into some new part of the terminal emulator new issues pop up! I'll try to sort those out too as it would be nice to be able to call that function "done" as much as possible for the VT220/320 emulations accuracy-wise. When I eventually get to VT420 and VT520 emulations DECUDK will require further work as they seem to support extra parameters for specifying modifiers and direction. As for which key sequences the UDKs are bound to and what they send by default, that was intended as an xterm-compatibility compromise. Until the host sends a DECUDK, the function keys will just do as xterm does for the K95 terminal type; VT220 and VT320 will reset to blank as the real terminals do (or at least as the VT220 does - looking forward to the day when something can run the VT320 firmware!). Though I've just fired up my VT520 and it seems to behave the same way - it doesn't initialize UDKs to blank:
So looks like xterm sends DECFNK for the function keys, and the VT520 initializes the UDKs to send DECFNK too rather than do nothing. The Shift+Alt+F6 -> F16 (or UDK F16) is perhaps an xtermism though. The LK401 of course has a real F16 key (Do) so programming key 29 alters Shift+Do rather than Shift+Alt+F6. Looking at the manual, I suspect with a PC keyboard the terminal just won't give you F13+ and so DECUDK won't let you modify what those keys send. I'll have to dig out a PS/2 keyboard and do some more tests to confirm. |
That much I understood, and that makes sense for VT5xx compatibility too I think. What was confusing me was how UDKs were cleared.
So I was assuming the erase control being set to "Clear all UDKs" would actually erase them, rather than resetting them back to a default mapping, although this makes sense in retrospect. I guess I'm just going to have to treat "level 5" terminals differently in my tests, which is a bit annoying. I haven't actually done much of anything at level 5, though, so there's a lot more keyboard work required there anyway. And just to be clear, on your VT520, if you did
That is actually documented in the VT520/VT525 manual (it may not apply to the VT510 though). All I was suggesting was that you could possibly support both, i.e. Shift+Alt+F6 should just be an alias for Shift+F16. I don't know about other platforms, but Windows is at least capable of supporting keyboards with all 20 function keys (it actually has virtual key codes up to F24). However, note that Shift+Alt+F1 and Shift+Alt+F2 are not intended to be aliases for Shift+F11 and Shift+F12. They're distinct key combinations as far as I understand. The table I'm referencing is on page 5-166 of EK-VT520-RM.A01. |
|
FYI, I've now updated my test suite to accept the erase control resetting the key definitions as an alternative to clearing them, so those tests are passing in Kermit again. |
|
Thanks for double checking that. I love seeing what the editor UI looks like on the actual device. But now I'm very curious to know how they achieved the "Define Key Editor" title. That surely can't just be a double-width line, because then the borders on that line would also be double-width, and out of alignment. Did they have the ability to control the width on individual cells, but just not expose that as an escape sequence? |
|
Yeah, that's interesting. I can't find any any other screens in the firmware that do something like this which makes it more surprising. Would be a bit of a waste of an attribute bit if double-width was really a per-cell thing. Unless perhaps they had plans to do more there but ran out of time. Would be interesting to see a disassembly of the firmware - perhaps there might be some undocumented modes or control sequences. |
|
Yeah, now that I think about it, it can't be an attribute bit, because I'm fairly certain I know what all the cell bits are used for from the Maybe they render the border directly onto the screen, similar to way the screen frame is done when framed mode is enabled ( My other thought was that it could have been a separate glyph that exactly matched the single-width border glyph once it was scaled, but I think I would have noticed that when I was dumping the glyph tables from the ROM. Not that it matters - just curious. And we might find out more if Blaze ever does a VT520 disassembly. |
… a partial hex code was encountered. STD 070 says the key definition and the rest of the DECUDK sequence should be ignored in this scenario. It doesn't say the rest of the DECUDK sequence should be dumped to the terminal. And the VT220, VT420 and VT520 I have access to don't behave in this way at all - they just ignore the partial hex code and continue on. As the old behaviour was at least partially consistent with the standard I can't rule out some DEC terminal out there behaving in the same way as past K95 releases, so for now the behaviour is just commented out.
Previously K95 would abort the DECUDK sequence dumping the remainder of the DCS buffer to the terminal in this scenario. This behaviour is commented out for now in case one of the other terminals K95 emulates really did behave this way.
|
I've just tested with the latest changes, and I've only got two test cases failing now. I've extracted the actual test definitions below in case that's helpful. They use the Given/When/Then syntax which I'm hoping is reasonably understandable. The "terminal is ready" step is just an operating status
|
… processed as DCS regardless of the set type. And also fix a larger issue: apcrecv is only reset on terminal reset. This means that once an APC has been received, *all* subsequent string-type escape sequences will be interprted as APC until terminal reset. This bug has existed since at least v1.1.11 (February 1997) and is now described as bug 845.
… causes a DCS (or any other escape sequence) to be aborted. So when emulating a VT220, translate SOS and PM into CAN rather than their two-byte representations. This also introduces a new 'strict emulation' setting which, when set, causes OSC and APC to be translated to CAN as well. This setting is hidden for now as it doesn't do much, but someday it should be extended to suppress all other extensions.
…es that DECUDK ignores.
…CDLD. Someday we need to switch to processing DCS one byte at a time as the real terminals do, rather than accumulating it all into a string which would remove the need for hacks like this. Also fix escape sequences that caused an abort not being processed correctly.
…a...f respectively in the DECUDK command string.
|
Those two should be fixed now! And I think K95s current DECUDK implementation should now match the VT220, VT420 and VT520 except for those VT420/520 features not currently implemented (support for up to 768 bytes on a single key, key modifiers, and direction). |
xterm behaves as the VT520 does, and Alt+Shift+F1..10 is mapped to K_UDF10...20, not 1...10.
|
The unexpected character test passes now, but the reset test is still failing for me. I've checked I'm on commit 95a1334, and I've run I've also tried running the test manually to make sure it wasn't an issue with my test framework - I tried three separate |
|
That last one should be fixed now! Not sure why it worked for me when I first tried it, but it was certainly broken! |
|
That's done it! All my DECUDK tests are passing now. If it was random memory, it could have just ended up with null bytes some of the time, which may be why it initially seemed to work for you. |
|
Btw are you intentionally resetting to blank in this case, rather than original |
…or the K95 terminal type
|
Nope, that was just me trying to fix a bug before my morning coffee! I was testing using the VT320 emulation, so completely missed that it should go back to sending DECFNK for the K95 terminal type (I've just confirmed the VT520 does do this too - you can't map a UDK to send nothing via DECUDK). Should be fixed now. Though the fix is probably going to be a temporary solution - I think when I get around to doing all the other VT420/VT520 keyboard stuff I'll have to change how this works a bit. Because a bunch of other keys can be programmed too, I think rather than defaulting the UDKs to some particular value instead I need to insert an extra layer into the key map system somewhere: |
|
Thanks for all your help in getting DECUDK all fixed up! As seems to be usual with these things, a lot of other bugs were uncovered in the process so its great to get all of that sorted and be able to call this function done for the time being! |


Now that UDKs can be locked and are locked by default, its safe to have them mapped by default for the K95 terminal type. All 20 UDKs are supported, and for the K95 terminal type they're automatically initialized with what xterm sends for Shift+F1...F10 and Alt+Shift+F1...F10.
This branch also has a fix for UDKs being reset on soft-reset, and the UDK lock not being reset to the users preference on hard reset, and a pile of other very long standing deviations from hardware behaviour as well just plain bugs.