gst-inspect: Fix pager color with less

Fixes #341
This commit is contained in:
Nicolas Dufresne 2018-12-19 16:06:40 -05:00
parent 33267b2ecc
commit 8f136e8d9f

View file

@ -41,7 +41,8 @@
# include <sys/wait.h>
#endif
#define DEFAULT_PAGER "less -F -X -R"
#define DEFAULT_PAGER "less"
#define DEFAULT_LESS_OPTS "FXR"
gboolean colored_output = TRUE;
@ -1891,6 +1892,9 @@ redirect_stdout (void)
pager = DEFAULT_PAGER;
argv = g_strsplit (pager, " ", 0);
/* Make sure less will show colors, cat and more always show colors */
g_setenv ("LESS", DEFAULT_LESS_OPTS, FALSE);
/* child process */
close (pipefd[1]);
dup2 (pipefd[0], STDIN_FILENO);