Why Microsoft WSL default terminal typing experience is better than other similar applications?

A developer (called by Nick Chronicles) published a feedback is not a problem at GitHub repo Windows Terminal's  Issue  - he was just curious how the terminal has so smooth effect of this input is achieved.

Nick felt this sense of smoothness is not available in other Windows applications, even the lightest  notepad.exe failed to provide this input experience. He also asked, whether this UI enhancements in the future will apply to all Windows applications.

Soon, in charge of the project's Windows development team members ( @ miniksa ) Nick of questions were answered.

miniksa said, keep the default terminal typing faster than other applications in the WSL, which in fact is their only job! In addition, it may be because they have to use Windows oldest and lowest-level API to complete the work.

Electron default terminal WSL is not related to other frame as many other layer or frame, it is not particularly a bare window, and without any additional components. They will come to deal with the content type of the message from the window (window messages) rather than some kind of event framework ((WPF, WinForms, UWP, Electron)), which is the core content transmitted through them there. Then, they use the GDI PolyTextOut dumped directly into the text window and not with frills.

miniksa explained, Notepad.exe really lightweight, but also having a plurality of controls on its window, and use of a library may edit control, to determine the text layout frame (and possibly other libraries or frameworks are used for internationalization support ...), which are making them as fast as WSL default input terminal. Of course, WSL also need to be trade-offs, unlike other applications to provide full internationalization support that.

Why do this? First, conhost.exe already very old. It must use all the underlying bare metal content, as it is in most other frameworks created previously created. Second, it needs to be kept as the underlying level, and it is a C / C ++ written, it needs to keep the bottom of the state in order to facilitate as much as possible available to third parties.

As for the other Windows applications have a chance to spend such a smooth input effect, miniksa feel almost no chance. These applications can in a simple way in any one language to call a method and text layout (layout text), without having to manually calculate pixel or care what their style using the font. And just miniksa manually calculated pixel region and a sliding region or the like is applied mathematics such WSL default input terminal causes faster.

Guess you like

Origin www.oschina.net/news/112320/why-typing-inside-wsl-terminal-better-than-every-other-app