Rawr

0
2 hours ago · Tech · 0 comments

Do you ever think about what exactly happens when you press the cursor left or arrow left key in a terminal? What happens when you press arrow up? What when you press the letter "e"? Well, raw mode in a terminal will make you think about all of this and much more. In the famous words of any Souls game: "beware, despair ahead". I am a bit exaggerating here (but only a bit). Once the basic loop is set up, things are pretty much okay as is. I have to admit I cheated a bit and used golang.org/x/term. I could have gone a level lower than that and used golang.org/x/sys. But when actually looking at what happens behind the scenes there are two very likely outcomes: I either copy and paste the Linux specific code, missing out on a lot of cross platform compatibility or I have to refresh on way more assembler than I ever wanted to again. Once the shell is done and I have a lot more spare time I might reconsider this and start pulling out these two dependencies, but not today. Before jumping…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.