# \[ANN\] TerminalPager.jl v0.2.0

**URL:** <https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616>\
**Category:** Package Announcements\
**Created:** [May 22, 2021, 1:15am UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616 "2021-05-22T01:15:13Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [May 22, 2021, 1:15am UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/1 "2021-05-22T01:15:13Z")

</div>

Hi!

I just tagged a new version of [TerminalPager.jl](https://github.com/ronisbr/TerminalPager.jl) with minor updates.

We have now two macros to help. The first one is called `@dpr` and can be used to access any documentation inside the pager:

```julia-repl
julia> @dpr write

```

 ![dpr_01](https://global.discourse-cdn.com/julialang/original/3X/2/d/2dd6f745cf77d5efee8edfbeef911d078686b6fb.png)

The second one is called `@stdout_to_pager` and can be used to redirect all `stdout` to the pager:

```julia-repl
julia> @stdout_to_pager for i = 1:100
       println("$(mod(i,9))"^i)
       end

```

 ![stdout_to_pager_01](https://global.discourse-cdn.com/julialang/original/3X/1/d/1d59a58821f4893629466e1df606f938749807b7.png)

We now also have a vertical ruler that can be toggle by hitting `r`:

 ![Captura de Tela 2021-05-21 às 22.13.42](https://global.discourse-cdn.com/julialang/original/3X/9/d/9d805ccf412f4ff281f8f8832a8bb33854a8d568.png)

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [May 22, 2021, 9:07am UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/2 "2021-05-22T09:07:37Z")

</div>

This looks really nice, I hope something like that gets in Base at some point…

What about naming the macro `@help` instead of `@dpr`? (what does `@dpr` stand for?)

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [May 22, 2021, 9:28am UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/3 "2021-05-22T09:28:27Z")

</div>

It is great, I use julia in terminal frequently, and @dpr is very useful for reading documentation 🙂 .

---

<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:** [May 22, 2021, 12:54pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/4 "2021-05-22T12:54:48Z")

</div>

> [@sijo](#):
>
> This looks really nice, I hope something like that gets in Base at some point…
> 
> What about naming the macro `@help` instead of `@dpr` ? (what does `@dpr` stand for?)

Thanks! Let’s see if I can make everything works fine to propose it to be merged into `stdlib`. My current problem is how to create tests.

`@dpr` stands for “docs pager”. I did not use `@help` since it is a very common name and can interfere with some existing codes.

> [@dmolina](#):
>
> It is great, I use julia in terminal frequently, and @dpr is very useful for reading documentation 🙂 .

Nice! 🙂

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [May 22, 2021, 1:12pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/5 "2021-05-22T13:12:38Z")

</div>

> [@Ronis\_BR](#):
>
> I did not use `@help` since it is a very common name and can interfere with some existing codes.

But wouldn’t this other `@help` macro most probably do a similar thing (meaning it’s unlikely that a user would use both)? To me it sounds a bit like an interpolation package that doesn’t want to define `interpolate` because it could clash with other interpolation implementations 🙂 .

---

<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:** [May 22, 2021, 1:19pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/6 "2021-05-22T13:19:12Z")

</div>

hum, good point. I will think about it 🙂

---

<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:** [May 22, 2021, 1:29pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/7 "2021-05-22T13:29:21Z")

</div>

> [@Ronis\_BR](#):
>
> I just tagged a new version of [TerminalPager.jl](https://github.com/ronisbr/TerminalPager.jl) with minor updates.
> 
> We have now two macros to help

So why this was a breaking change? I don’t see any breaking change in the [ChangeLog](https://github.com/ronisbr/TerminalPager.jl/blob/02d8c99d0655f0e7d365e387012dc0942e029b52/CHANGELOG.md#version-020) either

---

<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:** [May 22, 2021, 1:31pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/8 "2021-05-22T13:31:07Z")

</div>

> [@giordano](#):
>
> So why this was a breaking change? I don’t see any breaking change in the [ChangeLog](https://github.com/ronisbr/TerminalPager.jl/blob/02d8c99d0655f0e7d365e387012dc0942e029b52/CHANGELOG.md#version-020) either

It is not, but I thought I had to increment the minor version (pre-1.0) if I add a new feature. In this case, we have two new macros. Am I wrong?

---

<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:** [May 22, 2021, 1:32pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/9 "2021-05-22T13:32:42Z")

</div>

> [@Ronis\_BR](#):
>
> Am I wrong?

Yes: [PSA: If your package's version is of the form `0.y.z`, please do NOT bump the minor version for new features](https://discourse.julialang.org/t/psa-if-your-packages-version-is-of-the-form-0-y-z-please-do-not-bump-the-minor-version-for-new-features/46570).

The semver world is much easier if you use all three numbers instead of restraining yourself to just two: [How can we encourage Julia package developers to release version 1.0.0?](https://discourse.julialang.org/t/how-can-we-encourage-julia-package-developers-to-release-version-1-0-0/29124).

---

<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:** [May 22, 2021, 1:34pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/10 "2021-05-22T13:34:15Z")

</div>

> [@giordano](#):
>
> Yes: [PSA: If your package’s version is of the form `0.y.z`, please do NOT bump the minor version for new features](https://discourse.julialang.org/t/psa-if-your-packages-version-is-of-the-form-0-y-z-please-do-not-bump-the-minor-version-for-new-features/46570)

Oops, sorry 😅 I read that, but I confused minor version with the patch version.

---

<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:** [May 22, 2021, 1:36pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/11 "2021-05-22T13:36:29Z")

</div>

> [@giordano](#):
>
> The semver world is much easier if you use all three numbers instead of restraining yourself to just two: [How can we encourage Julia package developers to release version 1.0.0?](https://discourse.julialang.org/t/how-can-we-encourage-julia-package-developers-to-release-version-1-0-0/29124).

Yes, you are right. I just need to stabilize things and create a good set of tests before tagging 1.0.

---

<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:** [May 23, 2021, 2:16am UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/12 "2021-05-23T02:16:50Z")

</div>

> [@sijo](#):
>
> But wouldn’t this other `@help` macro most probably do a similar thing (meaning it’s unlikely that a user would use both)? To me it sounds a bit like an interpolation package that doesn’t want to define `interpolate` because it could clash with other interpolation implementations 🙂 .

I think you are right 🙂 I just tagged the v0.2.1 with `@dpr` replaced by `@help`. The old name is now deprecated.

---

<div class="post-metadata">

**Author:** ![JackDevine](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jackdevine/32/1048_2.png) [@JackDevine](https://discourse.julialang.org/u/JackDevine)\
**Post date:** [May 23, 2021, 4:19am UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/13 "2021-05-23T04:19:50Z")

</div>

This is great!

I think that the screenshot below the code

```julia
julia> @stdout_to_pager for i = 1:100
       println("$(mod(i,9))"^i)
       end

```

Is for a different example where you print a random 100x100 matrix.

Also, do you have any plans to make this a REPL mode? That way when you are `using TerminalPager`, you could hit a key to enter the pager mode, where all outputs are sent to the pager. Similar to how `?` and `]` work with the help and the package manager right now.

---

<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:** [May 23, 2021, 1:38pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/14 "2021-05-23T13:38:33Z")

</div>

Thanks!

> [@JackDevine](#):
>
> Is for a different example where you print a random 100x100 matrix.

Really? Everything seems right here. Can you please refresh the page?

> [@JackDevine](#):
>
> Also, do you have any plans to make this a REPL mode? That way when you are `using TerminalPager` , you could hit a key to enter the pager mode, where all outputs are sent to the pager. Similar to how `?` and `]` work with the help and the package manager right now.

What an amazing idea! I will see if I can do this 🙂

---

<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:** [May 23, 2021, 3:48pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/15 "2021-05-23T15:48:24Z")

</div>

> [@JackDevine](#):
>
> Is for a different example where you print a random 100x100 matrix.

The example displayed in announcement above seems to be the one in the [package usage section](https://ronisbr.github.io/TerminalPager.jl/dev/man/usage/):  
`rand(100,100) |> pager`

---

<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:** [May 23, 2021, 3:51pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/16 "2021-05-23T15:51:43Z")

</div>

@Ronis_BR, the key “freeze panes” functionality (_say, freeze 1 row and 1 column_) does not seem to be working on TerminalPager v0.2.1 and Julia 1.6.1.  
(_both Win10 and linux_)

Could you please verify? Thank 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:** [May 23, 2021, 5:01pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/17 "2021-05-23T17:01:42Z")

</div>

> [@rafael.guerra](#):
>
> @Ronis_BR, the key “freeze panes” functionality ( _say, freeze 1 row and 1 column_ ) does not seem to be working on TerminalPager v0.2.1 and Julia 1.6.1.  
> ( _both Win10 and linux_ )
> 
> Could you please verify? Thank you.

It is working here. I entered in the pager and typed `f`, then the command line as for the number of rows and columns to freeze. Can you please describe what you are 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:** [May 23, 2021, 5:17pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/18 "2021-05-23T17:17:03Z")

</div>

> [@JackDevine](#):
>
> Also, do you have any plans to make this a REPL mode? That way when you are `using TerminalPager` , you could hit a key to enter the pager mode, where all outputs are sent to the pager. Similar to how `?` and `]` work with the help and the package manager right now.

After digging into the internals of Pkg.jl, I could create a REPL mode! In this case, it should works just like the julia command line for all output that fits on the screen. If the output is larger, then if uses the pager.

In this case, I am getting the output from `display` of the returned object and also everything that was printed to `stdout`. Hence, `pretty_table` will also work here.

![Gravação de Tela 2021-05-23 às 14.06.59](https://global.discourse-cdn.com/julialang/original/3X/0/c/0c480112ef2b0d1d1b412352921e0c15239d2d03.gif)

I just need to polish it a little bit because some functionalities are not working, like pasting commands with `julia>` prefix.

P.S.: The REPL stdlib is very nice and the customization options are amazing! It just need better documentation. I will add it to my todo list.  
There are so many nice things that can be done with those modes!

---

<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:** [May 23, 2021, 5:21pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/19 "2021-05-23T17:21:56Z")

</div>

> [@Ronis\_BR](#):
>
> Can you please describe what you are doing?

Here it goes:

```julia
rand(100,100) |> pager
:f
Freeze rows (0): 1
Freeze columns (0): 1

```

then used the keyboard arrows to move around the table but no freeze effect is observed.

_ **NB:** tried also with no avail (in terms of freezing):_  
`DataFrame(rand(100,100),:auto) |> pager`

---

<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:** [May 23, 2021, 5:26pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616/20 "2021-05-23T17:26:11Z")

</div>

![Captura de Tela 2021-05-23 às 14.24.41](https://global.discourse-cdn.com/julialang/original/3X/e/d/edb05983bbbb51fe2a9fce0fc86bff55cd04ca1a.png)

It worked here. Notice that the first column is frozen and the first line also. The first column in this example contains `1` in the first row and only spaces afterwards. The first line is being shown even though we are not at the first line. Can you provide a screenshot?

[Next page](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616.md?page=2)
