Re: [hatari-devel] Hatari debug mode

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On Donnerstag, 31. Juli 2025 21:08:08 CEST Nicolas Pomar� wrote:

> do you know if there's a way to detect in which "context" Hatari was

> launched ?


You can use something like


CONSOLE_SCREEN_BUFFER_INFO ci;

   

if (GetConsoleScreenBufferInfo(GetStdHandle(STD_INPUT_HANDLE),&ci))

    /* we already have a console */


Theoretically, using isatty(0) should also work, but unfortunately that fails when using terminals like mintty, which use a pipe to communicate with the process, and then isatty() from the MSVCRT returns 0, even if the program was linked as console application.






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/