Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback on the testdecsm script #10

Open
j4james opened this issue Aug 21, 2021 · 5 comments
Open

Feedback on the testdecsm script #10

j4james opened this issue Aug 21, 2021 · 5 comments

Comments

@j4james
Copy link
Contributor

j4james commented Aug 21, 2021

I've tried this on a whole lot of Sixel clients, and it works really well for the most part, but the biggest issue is that a lot of them don't support DECRQM, which kind of messes up the script a bit. What happens is that it starts with an error, and claims that it is unable to set/reset DECSDM (even on clients that do actually support it).

./testdecsdm.sh: line 149: Terminal did not respond to inquiry for mode 80.: syntax error in expression (error token is "did not respond to inquiry for mode 80.")
The terminal was unable to set DECSDM
The terminal was unable to reset DECSDM

The main part of the test still works, though, so it correctly detects whether DECSDM matches the VT340 or not. But it also then ends with another error:

Unknown value 'Terminal' passed to setmode()

There were also a couple of clients that produced weird results, but those look like client bugs:

  1. VTE reports the DECSDM mode as set (the response from DECRQM), but it doesn't support the mode at all - it is actually permanently reset (the main cursor movement test does correctly detect that).
  2. Reflection Desktop reports the mode as not recognized, but it actually does support changing modes (again the main cursor movement test does correctly detect that).
  3. Contour is detected as permanently reset, even thought it does support changing modes, but that's just because Contour doesn't set the cursor position correctly (at least on the version I was testing - it is quite old though).

One other weird thing, which might be a bug in the test itself. On the VT240 (using the MAME emulator), it reports that it treats DECSDM the same as a genuine VT340 would, which is definitely not the case. The VT240 doesn't support the mode at all and is technically always set. I'll try and see if I can figure out where exactly it's going wrong.

Edit: I've just tested again on the VT240 and it's working fine now. I suspect the initial failure may have been a garbage CPR response because of flow control issues.

@j4james
Copy link
Contributor Author

j4james commented Aug 21, 2021

Btw, am I right in assuming this does actually work correctly on your VT340? I mean in terms of DECRQM reporting the DECSDM mode. It's just that I remember at one point we were speculating that DECRQM might not report DECSDM, because it wasn't listed as queryable in the VT340 manual.

Also is DECSDM reset by DECSTR or RIS?

@hackerb9
Copy link
Owner

I hadn't expected a lot of terminals to not support DECRQM, so I had written the testdecsdm to just bomb out. I've updated it so it should work now. Which sixel clients don't support DECRQM? And is it that they don't support DECRQM at all or that they don't support it for this particular mode?

I'm curious about the Contour bug since I wasn't sure that this heuristic was robust enough. Does it never position the text cursor at the end of the graphics? Or is it that 60 pixels is not far enough?

I'm glad you got the VT240 thing figured out since that would have baffled me. I've never used MAME to emulate a terminal. Is there a VT340 emulator in MAME?

@hackerb9
Copy link
Owner

Yes, DECRQM does work correctly on the VT340.

RIS, Hard Terminal Reset

RIS always reboots the VT340, including having to wait for all the power on self tests. All modes get reset to the saved user defaults.

Test 1a

With Sixel Scrolling enabled in the Graphics Set-Up menu, which is the factory default, and saved to NVRAM, I did this:

echo $'\e[?80h'        # Set DECSDM (disable sixel scrolling)
echo $'\ec'            # Reboot VT340

Result: Sixel scrolling was re-enabled (DECSDM reset).

Test 1b

With sixel scrolling disabled in the Set-Up menu and saved to NVRAM, I ran this:

echo $'\e[?80l'        # Reset DECSDM (enable sixel scrolling)
echo $'\ec'            # Reboot VT340

Result: Sixel scrolling was disabled (DECSDM set).

DECSTR

DECSTR, Soft Reset, is supposed to only reset the modes listed in table 13-1 of the VT340's text programming manual (EK-VT3XX-TP). DECSDM is not listed there, and indeed, DECSTR does not affect DECSDM.

Test 2a

With sixel scrolling enabled and saved as default, I ran this:

echo $'\e[?80h'        # Set DECSDM (disable sixel scrolling)
echo $'\e[!p'          # Soft terminal reset

Result: DECSDM unchanged (remains set, sixel scrolling disabled).

Test 2b

With sixel scrolling disabled and saved as default, I ran this:

echo $'\e[?80l'        # Reset DECSDM (enable sixel scrolling)
echo $'\e[!p'          # Soft terminal reset

Result: DECSDM unchanged (remains reset, sixel scrolling enabled).

@j4james
Copy link
Contributor Author

j4james commented Aug 23, 2021

Which sixel clients don't support DECRQM?

The ones I've got installed that didn't support it include the Windows console, Alacritty, st, Yaft, Rxvt, WezTerm, Contour, and of course the VT240 (via the MAME emulator). That said, I believe WezTerm and Contour have recently added support for it, but I'm not sure if those updates have been officially released yet. And I think the main build of Rxvt supports it, but not the sixel fork.

And is it that they don't support DECRQM at all or that they don't support it for this particular mode?

The ones mentioned above didn't support DECRQM at all. Reflection Desktop does support DECRQM, but it reports the DECSDM mode as being unrecognized, even though the mode does actually work.

I'm curious about the Contour bug since I wasn't sure that this heuristic was robust enough. Does it never position the text cursor at the end of the graphics? Or is it that 60 pixels is not far enough?

I think it always positions the cursor to the bottom right of the image, regardless of the mode, so making the image larger than 60 pixels wouldn't help.

Is there a VT340 emulator in MAME?

Unfortunately not. They've got what they call a "stub" for it, and at least some of the ROMs, but there's not enough hooked up for it to be of any use.

RIS always reboots the VT340, including having to wait for all the power on self tests. All modes get reset to the saved user defaults.

Cool. Thanks for the detailed answer.

@hackerb9
Copy link
Owner

The ones I've got installed that didn't support it include the Windows console, Alacritty, st, Yaft, Rxvt, WezTerm, Contour, and of course the VT240 (via the MAME emulator).

The only one of that list that I would have expected to not support DECRQM was Yaft, and that's because it's a VT100 with sixels grafted on. I clearly had no idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants