Show only the first page of rustc output.
cargo install cargo-firstpageAdd firstpage before any cargo command:
This runs cargo check but only shows the first page of output:
cargo firstpage checkThis runs cargo run -p myproject:
cargo firstpage run -p myprojectAll arguments after firstpage are passed directly to cargo without
exception. cargo-firstpage does not have any option is and not
parametrizable.
You can use it like this:
cargo watch -x "firstpage check"If you want to see just the first page of the build output while keeping your program’s error messages:
cargo watch -x "firstpage build" -x "run"For TUI (text user interface) programs, use this in one terminal:
CARGO_TERM_COLOR=always cargo watch \
-x "firstpage build 2>/tmp/logs" \
-x "run 2>>/tmp/logs"And this in another terminal:
tail -F /tmp/logsThis setup keeps your program's stderr output scrolling while only showing the first page of build messages.
If your shell prompt takes up more than one line, cargo-firstpage might
miscalculate how much space is available for output. To fix this, you can set
the PROMPT_SIZE compilation parameter when installing the tool.
If your prompt is 2 lines high:
PROMPT_SIZE=2 cargo install cargo-firstpage --forceAdjust the value of PROMPT_SIZE to match the number of lines your prompt
uses.
In most cases, the useful error messages appear at the end of the output.
However, sometimes rustc shows important information at the beginning, like
how to disable a warning.
This project does not accept issues, pull requests, or other contributions. Forks are welcome — feel free to use, modify, and build on it as needed.
- ograc: Shows diagnostic messages in reverse order, so important ones appear first. You can scroll up to see less important ones.
- cargo-cut-diagnostics:
Similar to
cargo-firstpage, but keeps the progress bar and offers more options. The author claims it processes cargo output more accurately. Try this if you have issues withcargo-firstpage. - bacon: Combines features of
cargo-watchwith a small TUI that makes it easier to filter and read logs. Worth checking out if you want to improve the readability and scrolling ofrustcoutput.