cargo-firstpage
Show only the first page of rustc output.
Installation
Usage
Add firstpage before any cargo command:
Examples
This runs cargo check but only shows the first page of output:
This runs cargo run -p myproject:
All arguments after firstpage are passed directly to cargo without
exception. cargo-firstpage does not have any option is and not
parametrizable.
Using with cargo-watch
You can use it like this:
If you want to see just the first page of the build output while keeping your program’s error messages:
For TUI (text user interface) programs, use this in one terminal:
CARGO_TERM_COLOR=always
And this in another terminal:
This setup keeps your program's stderr output scrolling while only showing the first page of build messages.
Troubleshooting
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.
Example
If your prompt is 2 lines high:
PROMPT_SIZE=2
Adjust the value of PROMPT_SIZE to match the number of lines your prompt
uses.
Limitations
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.
Contributing
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.
Related Tools
- 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.