For debugfs, use the "more" pager in preference to "less",
since "less" doesn't work terribly well for debugfs's purpose.
Document the DEBUGFS_PAGER and PAGER environment variables.
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 6f1ac91..59a7b76 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -64,7 +64,7 @@
If the environment variables DEBUFS_PAGER and PAGER are not set,
debugfs now searches for the appropriate pager to use, beginning with
-/usr/bin/pager, and then falling back to 'less' and 'more'.
+/usr/bin/pager, and then falling back to 'more' and 'less'.
(Addresses Debian Bug: #221977)
Fix regression tests so they work correctly when e2fsprogs is compiled
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog
index 4ca40ed..92b0d99 100644
--- a/debugfs/ChangeLog
+++ b/debugfs/ChangeLog
@@ -1,3 +1,12 @@
+2004-01-24 Theodore Ts'o <tytso@mit.edu>
+
+ * debugfs.8.in: Document the PAGER and DEBUGFS_PAGER environment
+ variables.
+
+ * util.c (open_pager): Use the "more" pager in preference to
+ "less", since "less" doesn't work terribly well for
+ debugfs's purpose.
+
2003-12-25 Theodore Ts'o <tytso@mit.edu>
* util.c (open_pager): Try to use the DEBUGFS_PAGER environment
diff --git a/debugfs/debugfs.8.in b/debugfs/debugfs.8.in
index 3cc0f96..944327b 100644
--- a/debugfs/debugfs.8.in
+++ b/debugfs/debugfs.8.in
@@ -434,6 +434,36 @@
and copy the contents of
.I source_file
into the destination file.
+.SH ENVIRONMENT VARIABLES
+.TP
+.B DEBUGFS_PAGER, PAGER
+The
+.BR debugfs (8)
+program always pipes the output of the some commands through a
+pager program. These commands include:
+.IR show_super_stats ,
+.IR list_directory ,
+.IR show_inode_info ,
+.IR list_deleted_inodes ,
+and
+.IR htree_dump .
+The specific pager can explicitly specified by the
+.B DEBUGFS_PAGER
+environment variable, and if it is not set, by the
+.B PAGER
+environment variable.
+.IP
+Note that since a pager is always used, the
+.BR less (1)
+pager is not particularly appropriate, since it clears the screen before
+displaying the output of the command and clears the output the screen
+when the pager is exited. Many users prefer to use the
+.BR less (1)
+pager for most purposes, which is why the
+.B DEBUGFS_PAGER
+environment variable is available to override the more general
+.B PAGER
+environment variable.
.SH AUTHOR
.B debugfs
was written by Theodore Ts'o <tytso@mit.edu>.
diff --git a/debugfs/util.c b/debugfs/util.c
index 4da7f6e..93ef751 100644
--- a/debugfs/util.c
+++ b/debugfs/util.c
@@ -56,7 +56,7 @@
#endif
}
-static const char *pager_search_list[] = { "pager", "less", "more", 0 };
+static const char *pager_search_list[] = { "pager", "more", "less", 0 };
static const char *pager_dir_list[] = { "/usr/bin", "/bin", 0 };
static const char *find_pager(char *buf)