bacon icon indicating copy to clipboard operation
bacon copied to clipboard

Option to stay scrolled to the bottom when command finishes

Open net opened this issue 1 year ago • 4 comments

~~Auto-scroll doesn't work for me. The output always remains at the top, and I have to press G after running to jump to the bottom.~~

Correction: auto-scroll works, but Bacon jumps to the top when the command finishes running. An option to stay at the bottom would be great!

Bacon 3.0.0

net avatar Oct 17 '24 15:10 net

When there's a long output during compilation, autoscroll to the bottom automatically happens. In such case, without user action, you see the output auto scrolling, then the whole is replaced by the report, and you see its top, most interesting part.

Autoscroll detection purpose is to detect when you scrolled to read something which isn't at the bottom, so that it doesn't get away.

The problem is we can't really detect that you want to be at the bottom and stay there after the scrolling output is replaced. What interaction do you suggest ?

Canop avatar Oct 22 '24 06:10 Canop

The top is not always the interesting part:

[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
    Finished `release` profile [optimized] target(s) in 0.02s
[INFO]: ⬇️   Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: ✨   Done in 1.08s
[INFO]: 📦   Your wasm pkg is ready to publish at ...
watchman warning:  Recrawled this watch 29 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del ... ; watchman watch-project ...`

 PASS  js/index.test.ts
  findOccurances
    ✓ should work (3 ms)
    ✓ supports word boundaries (1 ms)
    ✓ supports syllable boundaries (1 ms)

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        0.259 s, estimated 1 s
Ran all test suites.

I suggest a scroll_to_top_on_finish job property that defaults to true, that when false disables the jump to the top when the command finishes and keeps your scrolled-to place instead.

Or, if the way bacon works doesn't really support the idea of keeping your scolled-to place, then a scroll_to_on_finish property that can be top or bottom.

net avatar Oct 22 '24 19:10 net

any workaround for this? i'm just running a tiny example in a loop a billion times, and want to focus on the example's final output instead of initial compiler warnings during the build step. the whole process is over really fast, so the report is essentially the only thing I can see

talk about a first world problem, but having to move my hand all the way over to the other side of the keyboard to press the "End" key every time I save is annoying!

tried reverse = true in bacon.toml [jobs.ex] but it doesn't seem to do anything

if there's no dumb workaround, how about an autoscroll-to-bottom-of-report = true option ? or i suppose i could rebind "End"

bionicles avatar Mar 25 '25 21:03 bionicles

nevermind, i figured it out,

[jobs._]
# other config
on_success = "scroll-to-bottom"
on_failure = "scroll-to-bottom"

bionicles avatar Mar 25 '25 22:03 bionicles