dsherret / dax

Cross-platform shell tools for Deno and Node.js inspired by zx.
MIT License
1.02k stars 34 forks source link

Docker-Build Style Partial Window Scrolling #149

Open mmastrac opened 1 year ago

mmastrac commented 1 year ago

dax should implement a new feature that enables partial window scrolling in the terminal, similar to the behavior seen in the Docker build process.

The current behavior of dax when running scripts or applications that produce a large amount of output in the terminal makes it difficult to navigate through the output as it scrolls off the visible portion of the terminal window. The introduction of this feature would greatly enhance the developer experience by allowing users to easily scroll through and review the output without losing context.

This would require capturing output of a subcommand, limiting it to N lines, and performing a partial scroll of the terminal window when those N lines overflow.

An example, limited to 5 lines, might look like the below. Previous lines (output before the deno_napi line) would be hidden from view.

X running `cargo build`
   Compiling deno_napi v0.37.0 (/Users/matt/Documents/github/deno/deno/ext/napi)
   Compiling deno_url v0.107.0 (/Users/matt/Documents/github/deno/deno/ext/url)
   Compiling deno_ffi v0.94.0 (/Users/matt/Documents/github/deno/deno/ext/ffi)
   Compiling deno_net v0.99.0 (/Users/matt/Documents/github/deno/deno/ext/net)
   Compiling deno_fs v0.17.0 (/Users/matt/Documents/github/deno/deno/ext/fs)