summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2012-02-12 14:12:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-13 23:08:47 (GMT)
commitad6c3739a33586ba15a8c5c245dcd59e8a31cef1 (patch)
tree79f132fd18a6fee4f7d87e9c63a79c72baa8cbaf /cache.h
parentd0482e88a735787f7bb33ef4783be0e7f6a70946 (diff)
downloadgit-ad6c3739a33586ba15a8c5c245dcd59e8a31cef1.zip
git-ad6c3739a33586ba15a8c5c245dcd59e8a31cef1.tar.gz
git-ad6c3739a33586ba15a8c5c245dcd59e8a31cef1.tar.bz2
pager: find out the terminal width before spawning the pager
term_columns() checks for terminal width via ioctl(2) on the standard output, but we spawn the pager too early for this check to be useful. The effect of this buglet can be observed by opening a wide terminal and running "git -p help --all", which still shows 80-column output, while "git help --all" uses the full terminal width. Run the check before we spawn the pager to fix this. While at it, move term_columns() to pager.c and export it from cache.h so that callers other than the help subsystem can use it. Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 79c612f..c7e3b4d 100644
--- a/cache.h
+++ b/cache.h
@@ -1172,6 +1172,7 @@ extern void setup_pager(void);
extern const char *pager_program;
extern int pager_in_use(void);
extern int pager_use_color;
+extern int term_columns(void);
extern const char *editor_program;
extern const char *askpass_program;