mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'jn/pager-lv-default-env'
Just like we give a reasonable default for "less" via the LESS environment variable, specify a reasonable default for "lv" via the "LV" environment variable when spawning the pager. * jn/pager-lv-default-env: pager: set LV=-c alongside LESS=FRSX
This commit is contained in:
11
pager.c
11
pager.c
@@ -80,8 +80,15 @@ void setup_pager(void)
|
||||
pager_process.use_shell = 1;
|
||||
pager_process.argv = pager_argv;
|
||||
pager_process.in = -1;
|
||||
if (!getenv("LESS")) {
|
||||
static const char *env[] = { "LESS=FRSX", NULL };
|
||||
if (!getenv("LESS") || !getenv("LV")) {
|
||||
static const char *env[3];
|
||||
int i = 0;
|
||||
|
||||
if (!getenv("LESS"))
|
||||
env[i++] = "LESS=FRSX";
|
||||
if (!getenv("LV"))
|
||||
env[i++] = "LV=-c";
|
||||
env[i] = NULL;
|
||||
pager_process.env = env;
|
||||
}
|
||||
if (start_command(&pager_process))
|
||||
|
||||
Reference in New Issue
Block a user