chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a05ea46
)
systemctl: Don't use Debian's 'sensible-pager', use 'pager' instead
author
Lennart Poettering
<lennart@poettering.net>
Tue, 4 Jan 2011 13:51:48 +0000
(14:51 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 4 Jan 2011 13:54:53 +0000
(14:54 +0100)
src/systemctl.c
patch
|
blob
|
history
diff --git
a/src/systemctl.c
b/src/systemctl.c
index 5d2efbe95f8709026b7c1ff6044fdafc3af898e4..4f4ee961726ed7a6595bab372cc21f2294771e4d 100644
(file)
--- a/
src/systemctl.c
+++ b/
src/systemctl.c
@@
-118,6
+118,12
@@
static void pager_open(void);
static bool on_tty(void) {
static int t = -1;
static bool on_tty(void) {
static int t = -1;
+ /* Note that this is invoked relatively early, before we start
+ * the pager. That means the value we return reflects whether
+ * we originally were started on a tty, not if we currently
+ * are. But this is intended, since we want color, and so on
+ * when run in our own pager. */
+
if (_unlikely_(t < 0))
t = isatty(STDOUT_FILENO) > 0;
if (_unlikely_(t < 0))
t = isatty(STDOUT_FILENO) > 0;
@@
-5336,7
+5342,14
@@
static void pager_open(void) {
execlp(pager, pager, NULL);
execl("/bin/sh", "sh", "-c", pager, NULL);
} else {
execlp(pager, pager, NULL);
execl("/bin/sh", "sh", "-c", pager, NULL);
} else {
- execlp("sensible-pager", "sensible-pager", NULL);
+ /* Debian's alternatives command for pagers is
+ * called 'pager'. Note that we do not call
+ * sensible-pagers here, since that is just a
+ * shell script that implements a logic that
+ * is similar to this one anyway, but is
+ * Debian-specific. */
+ execlp("pager", "pager", NULL);
+
execlp("less", "less", NULL);
execlp("more", "more", NULL);
}
execlp("less", "less", NULL);
execlp("more", "more", NULL);
}