Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is almost always implemented using direct placement of the cursor, not via a literal CR char/command. CR is literally useless, except for being artificially required in some windows text editors.


Cursor placement is hard to do portably because every OS has incompatible ways for that. You gonna need SetConsoleCursorPosition on Windows, and multiple versions of these terminal escape codes on Linux.

printf( "\rsomething " ) is much easier.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: