contour-terminal / contour

Modern C++ Terminal Emulator
http://contour-terminal.org/
Apache License 2.0
2.39k stars 101 forks source link

Edit Mode and Interactive Mode (DECEDM) #717

Open christianparpart opened 2 years ago

christianparpart commented 2 years ago

While reading DEC STD 070 for implementing status line (#687), I came across the requirement to display DECEDM state in the Indicator line.

DECEDM is described in VT220/ANSI Terminal Emulation PROGRAMMER’S REFERENCE GUIDE, page 197.

Usecase?

I think what the Warp terminal is doing is great to see, but ultimatively the design is wrong way around. Instead of replacing the shell entirely, the shell should instead enable host, as is currently already done via shell integration. FinalTerm was very well known and (I think) actually the first terminal to introduce advanced semantic features.

So if a TE would want to take over command line editing, probably through the standardized VT sequence DECEDM. So if enable, the host (TE) can take over the input with all its completion features until the user submits the data to the application.

@j4james, I'm actually interested in your world-view on such a feature here. It would take some time until I'd actually implement this, but I see some great potential here. What do you think?

j4james commented 2 years ago

This is probably the one DEC feature that I'm not really interested in implementing. As I understand it, DECEDM is part of the Local Editing extension, which looks extremely complicated - there are more than a dozen modes and sequences you'd need to implement if you want to support it fully (see chapter 9 in the VT330/340 Text Programming manual).

That said, I haven't looked into it much detail, so maybe it's not as bad I think. But it just seemed like a lot of work for something that I didn't think was very likely to be used. There's also the complication that XTerm has reused mode 10 for hiding the toolbar, which could cause issues. It's possible that mode isn't included by default, though, so maybe it's not big deal.

Anyway, don't let me put you off if you see value in it. If I was further along with implementing all the other things on my list, I might actually be more interested. Just not right now.

christianparpart commented 2 years ago

Thanks for your input. It'll certainly take some time before seriously evaluating this. I do see some value, but I agree, that a lot of heads-up thinking is still left to evaluate whether my ideas above actually hold true. The status line however seems to be an amazing thing that I do not understand why it didn't have that much of an adoption in modern TEs. Hmm...