From: Nicolas Dufresne Date: Thu, 24 Jan 2019 18:52:46 +0000 (-0500) Subject: gst-inspect: Re-add DEFAULT_LESS_OPTS with initial value X-Git-Tag: 1.16.2~131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35300f8299210205c0f64654d6196b68eb696d78;p=platform%2Fupstream%2Fgstreamer.git gst-inspect: Re-add DEFAULT_LESS_OPTS with initial value Commit 56b4fbef5e6760adc927d0e1c7c8d6a0db9b785c refactored the pipe code to use GLib utility, but the patch was hading some other changed. LESS env was now hardcoded in the middle instead of from a define and was changed from FXR to -RX. The "-" is not even valid for LESS env, and with the lost of F, we would still use a pager when the content fits the terminal. --- diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index c581d7f..527d87f 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -43,6 +43,12 @@ #define DEFAULT_PAGER "less" +/* "R" : support color + * "X" : do not clear the screen when leaving the pager + * "F" : skip the pager if content fit into the screen + */ +#define DEFAULT_LESS_OPTS "RXF" + gboolean colored_output = TRUE; GPid child_pid = -1; @@ -1882,12 +1888,8 @@ redirect_stdout (void) argv = g_strsplit (pager, " ", 0); - /* "R" : support color - * "X" : Do not init/deinit terminal. Uncleared "inspected output" on terminal - * seems to be more useful - */ envp = g_get_environ (); - envp = g_environ_setenv (envp, "LESS", "-RX", TRUE); + envp = g_environ_setenv (envp, "LESS", DEFAULT_LESS_OPTS, TRUE); if (!g_spawn_async_with_pipes (NULL, argv, envp, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,