mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
pager: cache not only number of columns but also of lines before we open pager
Not that we need it, but let's do this as matter of completeness.
This commit is contained in:
parent
9e29521e27
commit
d13b522751
|
@ -80,9 +80,10 @@ int pager_open(bool no_pager, bool jump_to_end) {
|
||||||
if (pager && STR_IN_SET(pager, "", "cat"))
|
if (pager && STR_IN_SET(pager, "", "cat"))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Determine and cache number of columns before we spawn the
|
/* Determine and cache number of columns/lines before we spawn the pager so that we get the value from the
|
||||||
* pager so that we get the value from the actual tty */
|
* actual tty */
|
||||||
(void) columns();
|
(void) columns();
|
||||||
|
(void) lines();
|
||||||
|
|
||||||
if (pipe2(fd, O_CLOEXEC) < 0)
|
if (pipe2(fd, O_CLOEXEC) < 0)
|
||||||
return log_error_errno(errno, "Failed to create pager pipe: %m");
|
return log_error_errno(errno, "Failed to create pager pipe: %m");
|
||||||
|
|
Loading…
Reference in a new issue