I tried copying the entire code, but it didn’t work.
After looking more carefully through his code repository, I finally understood what he did. He used a clever “hack” to put the terminal into raw mode by implementing it in a C file. I copied that approach into my project, made a few adjustments, and now I can properly detect the input.
That was a tricky one!
Maybe it would be a good idea to include some guidance about this in the exercise, since it’s not something very common. In Rust, for example, you can just use the rustyline crate and don’t need to worry about this.