2

I am working with xv6 in WSL of Windows 10. After running make && make qemu-nox and quitting immediately from qemu, I need to check the output of make. But most lines of the output of make were removed; only a few lines at the end of the output burst are kept. I have changed the Buffer Size in "Command Prompt" Properties dialog from 50 to 500 but the same problem persists. Is there any working way to increasing the output buffer of the command window so that I can check the output of make && make qemu-nox from very beginning? Or, if the output is indeed removed by qemu or something else, how can I prevent such removal? Thanks a lot.

1 Answer 1

2

Properties -> Options -> Command History -> Buffer Size is the number of previous commandlines that Windows Console will remember. To change the scrollback buffer, you want Properties -> Layout -> Screen Buffer Size -> Height.

Since this defaults to a pretty large number already (9001 on my system), it's more likely that something in the build is calling the clear command (or writing its equivalent escape sequence to the terminal).

As possible workarounds, consider:

Using tmux

Perhaps this is overkill, but my normal workflow is to use tmux. It's installed by default in some distributions, but easily installable if not. As far as I can tell, its scrollback buffer is not cleared with the clear command (or its equivalent escape sequences).

To run it, and use it's scrollback feature:

  • The default scrollback buffer is 2000 lines. To change it, if you really do need more, create ~/.tmux.conf with the following line:
    set -g history-limit 10000
    
  • Run tmux
  • Run your build
  • To enter "copy mode", in which you can scroll back, press Ctrl+b (the tmux "prefix" chord), then press [ (I hope I have that correct - My settings are slightly different).
  • Then Pg-Up as needed
  • q will exit Copy Mode (or Ctrl+C)

Pipe to less

For a likely faster solution, if you choose not to use tmux, (make && make qemu-nox) | less should allow you to capture the full build into the scrollable less command.

Redirect to a file

(make && make qemu-nox) &> buildlog.txt

The &> is needed to redirect stderr to the file as well.

Redirect to a file while still displaying the output on screen

((make && make qemu-nox) 2>&1) | tee buildlog.txt

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .