Re: [hatari-devel] Hatari debug mode |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Hatari debug mode
- From: Thorsten Otto <admin@xxxxxxxxxxx>
- Date: Fri, 01 Aug 2025 18:16:37 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tho-otto.de; s=dkim; t=1754065008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Lzdwx97b2Zf1qoMeainIYEpsTkist2015aqtBSR2Z2o=; b=frSSzxJlLBc0azc4UqyXCMju2D3C48ovb9ikdW8hbaNMFiT7k7hIFX91mhNbNHfQND1oew S+/zLjztkXVDKhZo1cp70OswedvYM+MdUx7+vRUFcd0r4LB4VX9//kdA2Wl093jXDXqaP9 15l5Nrd3gnvRKyOP3NH7oekWEQnq/uZHVe5nJyQKtDybY4eWfr6q7OySc5TQMKdzyjBWLa cZ/gsHtIHijYwsAKsFAUUHlj/mMWRMUxkOA7UGHt6Y4j1W5GN4yORNMaq+p2/uZw+lcNKm wcWKxt1O2ta+a/lcZHfdd5WAEvwdB8FkuaQ415Qmq/OQKHOtdkQbq4OQva4FGg==
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.