summaryrefslogtreecommitdiff
path: root/lib/menu.c
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2014-11-05 21:43:12 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2014-11-05 21:43:12 +0200
commit2c9451c2b8c19e152e8880978a88eee2db76930a (patch)
treec19c488a930edb53381801097e4d54bc40258d4d /lib/menu.c
parenta90bf2f512e9b3cdb6436cf7dce71ec33d1fa680 (diff)
downloadbemenu-2c9451c2b8c19e152e8880978a88eee2db76930a.tar.gz
bemenu-2c9451c2b8c19e152e8880978a88eee2db76930a.tar.bz2
bemenu-2c9451c2b8c19e152e8880978a88eee2db76930a.zip
Check that getppid != 1
Diffstat (limited to 'lib/menu.c')
-rw-r--r--lib/menu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/menu.c b/lib/menu.c
index d37e212..56ed5ea 100644
--- a/lib/menu.c
+++ b/lib/menu.c
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <unistd.h>
#include <assert.h>
/**
@@ -66,7 +67,7 @@ bm_menu_new(const char *renderer, enum bm_prioritory prioritory)
if (renderers[i]->api.prioritory == BM_PRIO_TERMINAL) {
const char *term = getenv("TERM");
- if (!term || !strlen(term))
+ if (!term || !strlen(term) || getppid() == 1)
continue;
}