arakiken / mlterm

Other
156 stars 13 forks source link

[decsdm] scrolling/cursor-based-positioning when *sent* #23

Closed dankamongmen closed 3 years ago

dankamongmen commented 3 years ago

Please see https://github.com/dankamongmen/notcurses/issues/1782 for background context. DECSDM in MLterm is reversed compared to most terminals I've tested with (e.g. Alacritty, Contour, Kitty, XTerm, and WezTerm).

dankamongmen commented 3 years ago

It is only fair to cite the analysis of @j4james (see aforementioned bug); it is definitely possible to claim that yours is the correct interpretation of the relevant "standard". With that said, the (probably incorrect) behavior is very widespread and entrenched.

It's essentially a question of "do you want everything to have to work around your (correct) behavior, or accept this almost universal practice?" i don't envy you...but i would like this merged =]. thanks!

j4james commented 3 years ago

For the record, I don't think WezTerm actually implements DECSDM (I can see in the code that the mode is parsed, but it doesn't do anything with the value, and the version I tested certainly wasn't effected by that mode). So I wouldn't say there is a clear cut preference for how this is implemented.

I also wouldn't be surprised if XTerm corrects its implementation once presented with conclusive proof that the current behaviour is incorrect (which we'll hopefully have in a couple of weeks).

dankamongmen commented 3 years ago

I just want to say I agree with everything @j4james says here; the man speaks truth. So if y'all'd prefer to hold off, do as thou wilt.

arakiken commented 3 years ago

As a result of consideration, I merged your patch, thank you.

VT330/340 Programmer Reference Manual https://vt100.net/docs/vt3xx-gp/chapter14.html#S14.4 describes that DECSDM 'set' enables sixel scrolling, and xterm follows this description. But @ttdoda tested the behavior of DECSDM on actual VT382 and VT330 at 2012 and 2014, and he confirmed that the behavior of actual machines and the description of VT382 manual were the opposite of the description of VT330/340 manual. (@saitoha reported it to Thomas Dickey, but the behavior of xterm hasn't been changed.) https://twitter.com/ttdoda/status/246407060131020802 https://twitter.com/ttdoda/status/453216088902221824 https://twitter.com/ttdoda/status/479053314412126208

(Actually, it's more natual to think that DECSDM 'reset' enables Sixel Scrolling Mode because 'SDM' doesn't mean Sixel Scrolling Mode but Sixel Display Mode.)

DECSDM of mlterm was implemented according to this result. It is the same bahavior as RLogin which revived and implemented Sixel Graphics over ten years ago (at 2010). https://github.com/kmiya-culti/RLogin/

But which behavior is the same as the original machines is not a big issue now. Because xterm compatible behavior has been already widespread, I think that it should be adjusted to that.

Regards,

arakiken commented 3 years ago

I reverted this pull request, because xterm will change the behavior. https://github.com/arakiken/mlterm/commit/8763b09dad386c9d793df22dab89d73f49dad458 https://github.com/hackerb9/lsix/issues/41#issuecomment-902523933

dankamongmen commented 3 years ago

agreed with your action, sorry for taking you the wrong way =\

arakiken commented 3 years ago

Thanks very much for your detailed consideration and investigation. (I sent an email to Thomas Dickey in June, but I couldn't provide a sufficient basis.)