Skip to content

Commit 7de7e84

Browse files
committed
Merge branch 'js/stop-exporting-bogus-columns' into seen
When we cannot figure out how wide the terminal is, we use a fallback value of 80 ourselves (which cannot be avoided), but when we run the pager, we export it in COLUMNS, which forces the pager to use the hardcoded value, even when the pager is perfectly capable to figure it out itself. Stop exporting COLUMNS only when building on Windows to work around this issue. * js/stop-exporting-bogus-columns: pager: do not unnecessarily set COLUMNS on Windows
2 parents 488ea58 + 5109a07 commit 7de7e84

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pager.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,13 @@ void setup_pager(void)
111111
* to get the terminal size. Let's grab it now, and then set $COLUMNS
112112
* to communicate it to any sub-processes.
113113
*/
114+
#if !defined(WIN32) || defined(TIOCGWINSZ)
114115
{
115116
char buf[64];
116117
xsnprintf(buf, sizeof(buf), "%d", term_columns());
117118
setenv("COLUMNS", buf, 0);
118119
}
120+
#endif
119121

120122
setenv("GIT_PAGER_IN_USE", "true", 1);
121123

0 commit comments

Comments
 (0)