# \[ANN\] Announcing TerminalPager.jl

**URL:** <https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561>\
**Category:** Package Announcements\
**Created:** [April 18, 2021, 7:54pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561 "2021-04-18T19:54:13Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [April 18, 2021, 10:55pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/21 "2021-04-18T22:55:15Z")

</div>

To `echo` what @giordano said,

> [@giordano](#):
>
> Also, what `less` means is usually only clear to some Unix users. The others will find the name very confusing and hard to search

I would encourage using the word `pager` instead of `less`, since this isn’t actually using `less` and the `less` name is an obscure Unix joke (a backwards version of `more`) unfamiliar to some programmers.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [April 18, 2021, 10:56pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/22 "2021-04-18T22:56:31Z")

</div>

> [@Ronis\_BR](#):
>
> there was a request on Slack (Jerry Ling)

not gonna lie, my heart raced when I causally clicked on this post and saw my name.

This looks great! thanks for all the work on PrettyTables and this!

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 18, 2021, 10:56pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/23 "2021-04-18T22:56:37Z")

</div>

Yes, you are right. Maybe `crop = :pager` then.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [April 18, 2021, 10:57pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/24 "2021-04-18T22:57:30Z")

</div>

Tried in Win10 REPL terminal but do not manage to step-out by 10 columns when using SHIFT + left/right arrows.

IMHO and if it is not asking too much 🙂 , this pager would be even more useful if the row numbers and column numbers would always show up (like the _freeze_ function in MS Excel).

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 18, 2021, 10:57pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/25 "2021-04-18T22:57:53Z")

</div>

> [@jling](#):
>
> not gonna lie, my heart raced when I causally clicked on this post and saw my name.
> 
> This looks great! thanks for all the work on PrettyTables and this!

Thanks for your feedback! And sorry for not referencing you properly, I did not find your name in the list here on Discourse 🙂

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 18, 2021, 10:59pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/26 "2021-04-18T22:59:07Z")

</div>

> [@rafael.guerra](#):
>
> IMHO and if it is not asking too much 🙂 , this pager would be even more useful if the row numbers and column numbers would always show up (like the _freeze_ function in MS Excel).

This is difficult because it depends on the type of data you are printing.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [April 18, 2021, 11:00pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/27 "2021-04-18T23:00:49Z")

</div>

Though I would say `= TerminalPager.pager` or `= TerminalPager.Pager` is better than `= :pager` – functions (or objects) are better than symbols. Because then you don’t need a case analysis inside, you can just call whatever function was handed to you.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 18, 2021, 11:02pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/28 "2021-04-18T23:02:57Z")

</div>

> [@jzr](#):
>
> Though I would say `= TerminalPager.pager` or `= TerminalPager.Pager` is better than `= :pager` – functions (or objects) are better than symbols.

I mean, this would be inside PrettyTables. You have an option `crop = :none`, `crop = :vertical`, `crop = :horizontal`, `crop = :both`, and I would like to add `crop = :pager`.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [April 18, 2021, 11:13pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/29 "2021-04-18T23:13:21Z")

</div>

The crop parameter seems like it really wants to be a function object (\text{terminal size}, \text{string}) \to \text{string}, which seems different from what this pager is doing.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 18, 2021, 11:15pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/30 "2021-04-18T23:15:05Z")

</div>

No, it is just an option to switch between cropping mechanism in `pretty_table`. It cannot be an external function due to performance. PrettyTables avoid rendering lines and columns that won’t be shown.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [April 18, 2021, 11:19pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/31 "2021-04-18T23:19:47Z")

</div>

> [@Ronis\_BR](#):
>
> It cannot be an external function due to performance.

I haven’t benchmarked it so I’ll pipe down 🙂

---

<div class="post-metadata">

**Author:** ![Roger-luo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roger-luo/32/3399_2.png) [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Post date:** [April 18, 2021, 11:40pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/32 "2021-04-18T23:40:22Z")

</div>

would it make sense to have this as default for Julia doc strings in REPL? I find long docstring is hard to read sometimes, also FYI IPython has this as builtin feature I think.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 18, 2021, 11:56pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/33 "2021-04-18T23:56:39Z")

</div>

It makes sense! However, to make this available in Julia by default, we need **a lot** of tests! I count on the community to help me stabilize everything and find bugs 🙂

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 18, 2021, 11:57pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/34 "2021-04-18T23:57:38Z")

</div>

Question: `pager` seems not an usual word. I think we can export it so that people can use it more easily (typing less):

```julia
julia> @doc(pretty_tables) |> pager

```

What do you think?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 19, 2021, 12:06am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/35 "2021-04-19T00:06:57Z")

</div>

Any way to change the keybindings? My terminal emulator steals all Shift + arrows sequences, so I can’t ever move quicker than one column/row at the time

---

<div class="post-metadata">

**Author:** ![jacobadenbaum](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jacobadenbaum](https://discourse.julialang.org/u/jacobadenbaum)\
**Post date:** [April 19, 2021, 12:20am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/36 "2021-04-19T00:20:54Z")

</div>

One thing that would be really nice would be to show the column names when scrolling down through a large table. I guess you could do that if there was an easy way to freeze the first few rows of output (for a prettytables printout of a dataframe, it would be 4?)

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [April 19, 2021, 12:40am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/37 "2021-04-19T00:40:10Z")

</div>

This is one of those packages where I think to myself, “This is such a genius idea! Why isn’t this already in base?” 😃

Kudos on a great package - looking forward to using it!

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [April 19, 2021, 12:47am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/38 "2021-04-19T00:47:04Z")

</div>

So this is glorious. Far exceeded my expectation that someone wrote a hook between a pager and a terminal window. I mean… I’d be happy to have either, but seeing this - it’s very useful.

Edit - if you don’t know what a pager is ask a parent or google.

---

<div class="post-metadata">

**Author:** ![tchr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tchr/32/15138_2.png) [@tchr](https://discourse.julialang.org/u/tchr)\
**Post date:** [April 19, 2021, 1:36am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/39 "2021-04-19T01:36:41Z")

</div>

There was this recently merged PR which has some overlap with this package [https://github.com/JuliaLang/julia/pull/38956](https://github.com/JuliaLang/julia/pull/38956) (though horizontal scrolling might not be in its scope; but display of long documentation certainly could be).

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [April 19, 2021, 1:55am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/40 "2021-04-19T01:55:36Z")

</div>

> [@giordano](#):
>
> Any way to change the keybindings? My terminal emulator steals all Shift + arrows sequences, so I can’t ever move quicker than one column/row at the time

Unfortunately they are hard-coded in this version, but it can be easily done. I will think about a good way to make this configurable.

> [@jacobadenbaum](#):
>
> One thing that would be really nice would be to show the column names when scrolling down through a large table. I guess you could do that if there was an easy way to freeze the first few rows of output (for a prettytables printout of a dataframe, it would be 4?)

Hum, it is very easy to freeze lines and columns when printing. In fact, this would also solve the request of @rafael.guerra. However, the user would need to select how many lines and columns they want to freeze, it cannot be automatically inferred. I will try to do that 🙂

> [@TheCedarPrince](#):
>
> This is one of those packages where I think to myself, “This is such a genius idea! Why isn’t this already in base?” 😃
> 
> Kudos on a great package - looking forward to using it!

Thank you very much 🙂 !

> [@anon92994695](#):
>
> So this is glorious. Far exceeded my expectation that someone wrote a hook between a pager and a terminal window. I mean… I’d be happy to have either, but seeing this - it’s very useful.
> 
> Edit - if you don’t know what a pager is ask a parent or google.

Thanks! Yeah, I am afraid I am from this generation that actually knows what a pager is… I am becoming somewhat old I think 😃

> [@tchr](#):
>
> There was this recently merged PR which has some overlap with this package [Implement basic pager using TerminalMenus by MichaelHatherly · Pull Request #38956 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/38956) (though horizontal scrolling might not be in it’s scope; but display of long documentation certainly could be).

Nice! I did not know about that, thanks for pointing this out.

[Previous page](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561.md?page=1)

[Next page](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561.md?page=3)
