title: How to write a terminal emulator from scratch (or not from scratch)?
body: <p>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).</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>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.</p>
  
  <p>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.</p>