Skip to content

Commit

Permalink
lstopo: only show interactive help if stdout is a tty
Browse files Browse the repository at this point in the history
Otherwise things like .xsession-errors (depending on the window manager)
might get flooded with those messages.

Ignored on Windows since I have now idea where those messages go
when the app doesn't run from a terminal.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Sep 23, 2022
1 parent 2993fba commit 1a64268
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/lstopo/lstopo.c
Expand Up @@ -577,9 +577,11 @@ void usage(const char *name, FILE *where)

void lstopo_show_interactive_help(void)
{
#ifdef HAVE_ISATTY
if (!isatty(STDOUT_FILENO))
/* don't send the interactive help when not a terminal */
return;
#endif

printf("\n");
printf("Keyboard shortcuts:\n");
Expand Down

0 comments on commit 1a64268

Please sign in to comment.