sunriseos / SunriseOS

Horizon/NX kernel reimplementation
Apache License 2.0
229 stars 13 forks source link

stty icrnl #307

Open Orycterope opened 5 years ago

Orycterope commented 5 years ago

Running qemu with -serial stdio unsets the icrnl property of the terminal (stty -a), and fucks up subsequent calls to read, git add -p, and other interactive prompts.

This property is documented as :

[-]icrnl
              translate carriage return to newline

Not sure if this is related to the color we put in the serial output, or not even related to sunrise but actually to cargo-make.

Edit: Happens in zsh, but not in bash.

roblabla commented 5 years ago

And never resets it? That should probably be reported upstream if so.

Orycterope commented 5 years ago

Yeah, I just need to do a little bit more investigation.

For now it seems it only does it when qemu is run in cargo-make. So I think cargo-make is to blame.

roblabla commented 5 years ago

🤔 cargo-make doesn't do any fuckery with the terminal (except for inserting colors) - it has to stay simple since it has to work on windows.

However, qemu might be doing weird stuff due to how cargo-make launches qemu. cargo-make goes through rust's built-in Command. stuff (as can be seen here).

Could also be that CTRL+C is not properly reaching qemu, but instead reaches cargo-make, which dies, and the kernel will terminate qemu without properly shutting it down, or something along those line?