简体   繁体   中英

How to write a terminal emulator from scratch (or not from scratch)?

As an exercise I'd like to write a terminal emulator for Linux from scratch in order to understand what moving parts are involved into it. My language of choice is D (because I'm learning it currently).

It obviously doesn't have to be something big. I'd like it to have a window with a background color (and opacity, later) displaying command promt. User may type in a command and it will spew out the result. Basic stuff. Except I'm not even sure where to start.

I suppose the visual part should be handled by something like gtk (which I never worked with), but what about everything else? Can someone please describe a possible architecture and what should I be looking at?

It would also be helpful to know which parts it makes sense to write from scratch (given my language of choice) and which parts I can use as third-party libraries or binaries.

I also realize there might exist other questions like this one, but I couldn't find quality answers. If you know such answers, please link to them.

You already have an excellent terminal emulator implemented in D under Mozilla Public License. The code is here: https://github.com/gnunn1/terminix/tree/master/source/gx/terminix/terminal

A good start however would be Adam Ruppe's (author of "D Cookbook") https://github.com/adamdruppe/terminal-emulator .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM