2

I do not want to clear screen when using .

Have tried things like, as per man for debugfs:

export PAGER='less -FX'
debugfs foo bar

export DEBUGFS_PAGER='less -FX'
debugfs foo bar

DEBUGFS_PAGER='less -FX' debugfs foo bar

PAGER='less -FX' debugfs foo bar

DEBUGFS_PAGER='less -FX' PAGER='less -FX' debugfs foo bar

but commands, for example ls, still show a full screen page which are cleared after q.

What I should do is?


Update:

As per comment by thrig I created the file .terminfo/xterm-nopager.terminfo from a copy of infocmp, modified it to exclude rmcup and smcup and ran:

tic ~/.terminfo/xterm-nopager.terminfo

This works (besides, obviously, from options to less like F not being honored.)

Is there a way to do this without modifying terminfo? I do not like to modify essentials like that on a global scale. (That is; I am not sure if I should care or not, so I do.)

Is this a bug in debugfs, as man say one can override, or is it a consequence of other external environment? Is there a way to do this per command?

  • Probably actually a terminal question about the evil alternate screen that so infuriatingly blanks the docs you were just looking at - shallowsky.com/linux/noaltscreen.html – thrig Feb 24 '16 at 22:44
  • @thrig: Thanks. That worked. But man for debugfs states one can set pager manually. I'll explore a bit further. – user367890 Feb 24 '16 at 23:17
0

The answer is, don't use a pager :-) This may not be what you want, since it doesn't set a pager, but the following works for me (in bash, in a fresh terminal), with values set accordingly (you can of course one-line this):

INODE='01234567'        # replace with valid inode# for some file
DEVICE='/dev/whatever'  # replace with valid device for that inode
# your distro might not require `sudo`, mine does
sudo debugfs -R 'stat <'"${INODE}"'>' "${DEVICE}" 2>/dev/null | tee

I get sudo-prompted, then the data writes to stdout normally, as if unpaged--particularly, the screen does not get cleared. This is what I want; YMMV, HTH.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.