5 ms·
It's kind of incredible that after ~20 years of programming I'd never come across anything illuminating this breakdown: > The terminal emulator is a graphical
by westoncb 5y ago
It's kind of incredible that after ~20 years of programming I'd never come across anything illuminating this breakdown:
> The terminal emulator is a graphical application whose role it is to interpret data coming from the shell and display it on screen. This display is often textual but not always.
> The shell provides an interface to the operating system, allowing the user to interact with its file-system, run processes and often have access to basic scripting capabilities.
> These two programs are connected together by the pty (pseudoterminal) which provides a bi-directional asynchronous communication channel between the two.
- kevstev 5y agoDid you have a formal cs education? This was covered in my operating systems class- we had to write a basic shell as an assignment.
- westoncb 5y agoYep, I did, though I didn't take an OS class. What's significant about the article (imo) is in pedagogy. I've never been particularly interested in OS implementation details or shell programming, but just because it's around I have some level of curiosity and have wondered something roughly like, "why doesn't anyone ever just say what a shell/terminal is?"—basically I was looking exactly for a concise architectural breakdown like the author gave, just as a brief answer to a quick question, and hadn't come across it until now.
- kevstev 5y agoInteresting, it was a required class in my program. Writing a shell is definitely a useful exercise, you may want to give it a go. We focused more on signal handling and forking/exec'ing processes though and less on display features, though from what I recall there was some raw/canonical mode stuff we had to deal with.
- westoncb 5y agoIn my program we could do either compilers, OSes, or networks. That does sound like a fun project though—if I wanted to learn more in the area, building a toy shell is definitely the direction I'd go.