I am releasing today TerminalPager.jl v0.5 with some nice new features (and some breaking changes :D).
Visual Mode
We now have a visual mode (type v), where you can see a vertical visual line to scroll through the data. You can also mark lines (type m). This feature helps when analyzing very big tables and you want to have a visual mark.
It is also possible to copy (type y) the selected lines which is helpful, for example, to copy and paste examples in the documentation.
Alternate Screen Buffer
The pager now supports using the terminal alternate screen buffer (Thanks @digital_carver!). Hence, when opening a help doctoring, for example, your current output will not be modified after you exit the pager.
Customization
All the customization is now handled by Preferences.jl and persists between sections. Hence, if you want to change the active visual line color, you can do:
wow, cool package! I was just looking for something like this the other day.
I just tried out v0.5 and after realizing I should set "always_use_alternate_screen_buffer_in_repl_mode" to true, I am very happy using it to inspect NetCDF datasets!.
A few suggestions:
Make it clear what the preference keys are, their defaults and their impacts (I had to look at the TerminalPager.pager function docs to find the preferences, and then look at TerminalPager.set_preference! to figure out how to set them. It would be useful to new users like myself if this was a separate doc page!
Add a doc page for keybindings. I see there’s function docs for set_keybinding, but it’s not clear to me which keybindings are available by default, and what all the available actions actually mean!
To me (and I suspect most other users), this is a package that would live in my (@v1.9) environment, and added to startup.jl so that it’s accessible in every other environment I work in. I would suggest basically adding this (Installation · OhMyREPL) to your docs, with the caveat that on newer versions on julia it should be sufficient with simply using TerminalPager in startup.jl.
Make it clear what the preference keys are, their defaults and their impacts (I had to look at the TerminalPager.pager function docs to find the preferences, and then look at TerminalPager.set_preference! to figure out how to set them. It would be useful to new users like myself if this was a separate doc page!
Yes, I fully agree that we need better documentation Thanks for the suggestions.
Add a doc page for keybindings. I see there’s function docs for set_keybinding, but it’s not clear to me which keybindings are available by default, and what all the available actions actually mean!
Ok! In the mean time, you can press ? in the pager to show all the available keybindings.
To me (and I suspect most other users), this is a package that would live in my (@v1.9)environment, and added to startup.jl so that it’s accessible in every other environment I work in. I would suggest basically adding this (Installation · OhMyREPL ) to your docs, with the caveat that on newer versions on julia it should be sufficient with simply using TerminalPagerin startup.jl.
I’ve just discovered this amazing package today. Thank you for this glorious work and for PrettyTables .
Do you have any plan to add a function to mark (like select_visual_line) all lines highlited by a search ?
That would be really useful in a scenario where you search & mark all resulting lines multiple times and then copy everything in the clipboard.
And the icing on the cake, to add a way to change the “format” of the rows/line in the clipboard (to paste it as markdown table or as a “tsv” table if you need to put those lines as is in a spreadsheet editor) ?
I’ve just discovered this amazing package today. Thank you for this glorious work and for PrettyTables .
Thanks!!
Do you have any plan to add a function to mark (like select_visual_line) all lines highlited by a search ?
I have never thought about it, but it seems a very nice feature! This feature is very easy to implement, we just need to think about the keybindings. For example, you perform a search. What would you type to mark all the lines with one or more matches?
And the icing on the cake, to add a way to change the “format” of the rows/line in the clipboard (to paste it as markdown table or as a “tsv” table if you need to put those lines as is in a spreadsheet editor) ?
This feature would be almost impossible. Since we are only copying text, and it can be anything, I have no idea how to implement something that will do this kind of conversion. Maybe this should be implemented in an external package that TerminalPager.jl can use as extension later on.