Comments (3)
This is a great idea. I already had a similar idea where a static banner could be added to the file which gets shown at the top. I was anticipating using that for showing titles, which would be particularly useful for controlled mode.
This is subtly different: my proposed banners would be entirely static, whereas (I assume) these sticky header lines would scroll left and right with the content. You could also use it, e.g. for showing large tables of SQL output, where you can make the first 3 lines sticky and only the data scrolls.
I'm not sure custom ANSI sequences would work so well, as I'm not sure what they'd mean anywhere but at the top. Instead I propose the following (defining some terms while I'm at it):
-
The header is an initial number of file lines that are always shown at the top of the file-view portion of the screen. They scroll left and right with the rest of the content when wrapping is disabled, but do not scroll up and down.
-
The header can be controlled by keyboard shortcuts, increasing or decreasing the number of lines.
-
The header's initial size can be set by command line flags (on a per-stream basis). For example:
git log -p | sp --header-lines=3
-
The header's initial size can also be set using parameters to the
Pager
when using streampager as a library.
-
-
The banner is a set of lines that is always shown at the top of the screen above the file content. It can only be set when using streampager as a library.
from streampager.
If you think an escape sequence might be useful (e.g. because you want a template to print it out to get the right line), then perhaps we could use an OSC sequence. Something like:
ESC ] streampager ; set-end-of-header BEL
This should be ignored by terminals, I believe.
In termwiz it gets parsed as OperatingSystemCommand::Unspecified(["streampager", "set-end-of-header"])
which should make it easy enough to parse out in line.rs
.
from streampager.
Once this feature is in, it would be nice to also have keyboard shortcuts to scroll between the headers. I often review a series of patches by running hg log -pvr <some revset>
. It would be nice to be able to press some key(s) to get the next/previous changeset/file header at the top of the screen.
from streampager.
Related Issues (20)
- streampager crashes if input file is truncated
- hyperlink escape sequences are not passed through
- Allow defining an alternate keymap in a config file HOT 1
- Streampager abort when piping files into xargs hg blame HOT 2
- Cursor disappears in tmux HOT 12
- Search query should be remembered for next run HOT 3
- Add mode that doesn't consume key presses before `sp -X` switches to fullscreen HOT 1
- Mouse selection disappears when scrolling up HOT 2
- Streampager eats my colors when using `delta` as a pager HOT 1
- Make the height of stderr panel configurable HOT 3
- Make Ctrl+C when entering search string abort search
- Scrolling in VSCode terminal is flaky
- With startup_pull_input = false, Ctrl+C/Ctrl+Z etc are not responding
- Support Ctrl-Z in fullscreen mode
- Ruler bar style configuration
- hyperlink shows with extra slashes HOT 5
- Idea: binding searches to keys
- Missing git tag for the 0.10.3 version HOT 1
- FR: Dark theme HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streampager.