X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemctl.c;h=2c8c2cf61d5165036beffe54ec8784a67dc0a2e1;hp=4f4ee961726ed7a6595bab372cc21f2294771e4d;hb=4bc5f808e4c4891451b83abbc85c4830b3788782;hpb=3add4d215b30c746ee617d7412ee007ed3c87249 diff --git a/src/systemctl.c b/src/systemctl.c index 4f4ee9617..2c8c2cf61 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -5316,6 +5316,10 @@ static void pager_open(void) { if (!*pager || streq(pager, "cat")) return; + /* Determine and cache number of columns before we spawn the + * pager so that we get the value from the actual tty */ + columns(); + if (pipe(fd) < 0) { log_error("Failed to create pager pipe: %m"); return;