so I'm using NCurses for a project and the terminal I'm using it on accepts special escape sequences for custom features like playing audio. The position of the cursor doesn't matter while sending these escape sequences, however when using printf it doesn't get pushed to the output stream. Is there a way to write to bypass ncurses and write to the terminal directly? I heard about possibly restoring the streams and after giving them back to ncurses but that seems hacky.
I ended up finding a hacky solution since I only needed the escape codes to be sent to the terminal emulator (cursor position & other context didn't matter)
I used fputs to write to STDOUT and then used fflush() to push it to the terminal.
fputs("\033]16;2", stdout);
fflush(stdout);