VT52 cursor left sequence conflicts with VT100 index sequence #212

Closed
opened 2026-01-30 21:45:46 +00:00 by claunia · 4 comments
Owner

Originally created by @j4james on GitHub (Mar 31, 2018).

  • Your Windows build number:

Microsoft Windows [Version 10.0.16299.309]

  • What you're doing and what's happening:

I was trying to use the IND (index) sequence, ESC D, which is defined in the VT100 manual as follows:

This sequence causes the active position to move downward one line without changing column position. If the active position is at the bottom margin, a scroll up is performed.

But instead of moving down a line, it moved left. Example test case:

printf "  x\033D\033D\033Dy\n"

In a Windows 10 bash console, this produces the following output:

y x

In a Linux console it works as expected:

  x
  
  
   y

I assume this is because the sequence is being interpreted as a VT52 cursor left command, but typically those VT52 sequences would only be active on a VT100 compatible terminal when the DECANM mode had been set to VT52, if at all.

  • What's wrong / what should be happening instead:

I would expect the ESC D sequence to be interpreted as a VT100 index command, and not a VT52 cursor left command.

I understand that not every VT100 sequence is going to be supported, but when that is the case, I would expect the sequence to be ignored completely. And to avoid conflicts like this, I think it would be preferable if any supported VT52 sequences were only active when the VT52 compatibility mode was actually enabled.

Originally created by @j4james on GitHub (Mar 31, 2018). * Your Windows build number: Microsoft Windows [Version 10.0.16299.309] * What you're doing and what's happening: I was trying to use the IND (index) sequence, `ESC D`, which is defined in the VT100 manual as follows: > This sequence causes the active position to move downward one line without changing column position. If the active position is at the bottom margin, a scroll up is performed. But instead of moving down a line, it moved left. Example test case: printf " x\033D\033D\033Dy\n" In a Windows 10 bash console, this produces the following output: y x In a Linux console it works as expected: x y I assume this is because the sequence is being interpreted as a VT52 _cursor left_ command, but typically those VT52 sequences would only be active on a VT100 compatible terminal when the DECANM mode had been set to VT52, if at all. * What's wrong / what should be happening instead: I would expect the `ESC D` sequence to be interpreted as a VT100 _index_ command, and not a VT52 _cursor left_ command. I understand that not every VT100 sequence is going to be supported, but when that is the case, I would expect the sequence to be ignored completely. And to avoid conflicts like this, I think it would be preferable if any supported VT52 sequences were only active when the VT52 compatibility mode was actually enabled.
claunia added the Product-ConhostIssue-BugArea-VTResolution-Duplicate labels 2026-01-30 21:45:46 +00:00
Author
Owner

@WSLUser commented on GitHub (Apr 25, 2018):

While we're at it, I'm wondering if there can be a user setting in form of a drop-down menu to choose between different VT sequences. For example here we'd need a setting for VT100 and another setting for VT52. Choosing the VT would load the behavior associated to it and fall back to what conhost considers default in whatever behavior implementations haven't yet been implemented for a particular VT sequence.

@WSLUser commented on GitHub (Apr 25, 2018): While we're at it, I'm wondering if there can be a user setting in form of a drop-down menu to choose between different VT sequences. For example here we'd need a setting for VT100 and another setting for VT52. Choosing the VT would load the behavior associated to it and fall back to what conhost considers default in whatever behavior implementations haven't yet been implemented for a particular VT sequence.
Author
Owner

@zadjii-msft commented on GitHub (Apr 25, 2018):

That'd be great to enable support for different term levels, but I can't see a world where we get to that in any sort of reasonable time frame. Just way too far down a really long backlog :/

@zadjii-msft commented on GitHub (Apr 25, 2018): That'd be great to enable support for different term levels, but I can't see a world where we get to that in any sort of reasonable time frame. Just way too far down a really long backlog :/
Author
Owner

@WSLUser commented on GitHub (Apr 25, 2018):

I didn't want to mention it because it would be better to get this natively "under the hood" but a viable, potentially faster solution may come from the new set of APIs you guys are building if anything in there is able to be tweaked to allow this kind of thing from a terminal such as Konsole that will utilize these new APIs (no I don't expect Konsole itself to support it though it'd be pretty cool if KDE folks implemented it as well). Also, I did put the caveat "default to..." because of course we'd all be skeletons by the time every term level was fully supported.

I know you guys are trying to make the console look like xterm but it may be easier trying to reproduce a project like eterm or LXTerminal which are xtermish but with less code than xterm proper.

@WSLUser commented on GitHub (Apr 25, 2018): I didn't want to mention it because it would be better to get this natively "under the hood" but a viable, potentially faster solution may come from the new set of APIs you guys are building if anything in there is able to be tweaked to allow this kind of thing from a terminal such as Konsole that will utilize these new APIs (no I don't expect Konsole itself to support it though it'd be pretty cool if KDE folks implemented it as well). Also, I did put the caveat "default to..." because of course we'd all be skeletons by the time every term level was fully supported. I know you guys are trying to make the console look like xterm but it may be easier trying to reproduce a project like [eterm](https://github.com/mej/Eterm) or [LXTerminal](https://wiki.lxde.org/en/LXTerminal) which are xtermish but with less code than xterm proper.
Author
Owner

@miniksa commented on GitHub (May 29, 2019):

This is #976. I'm going to close this one as the other one is marked up more appropriately and they'll get linked by talking about this.

@miniksa commented on GitHub (May 29, 2019): This is #976. I'm going to close this one as the other one is marked up more appropriately and they'll get linked by talking about this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#212