# \[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:** 12\
**Page:** 3

<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, 2:11am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/41 "2021-04-19T02:11:27Z")

</div>

@giordano btw, would CTRL solve your problem? Like CTRL + arrows? I can make a switch to use CTRL instead SHIFT to modify the “speed”.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [April 19, 2021, 8:26am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/42 "2021-04-19T08:26:20Z")

</div>

An option for scrolling the docs like this might be a great enhancements for Base Julia IMHO!

---

<div class="post-metadata">

**Author:** ![mike](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike/32/39_2.png) [@mike](https://discourse.julialang.org/u/mike)\
**Post date:** [April 19, 2021, 8:53am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/43 "2021-04-19T08:53:21Z")

</div>

Yeah, not in scope for that feature, it’s just for vertical scrolling. `?` mode doesn’t use it yet by default for long docstrings, but shouldn’t be much work to do, I just didn’t have the time to do the integration (nice first issue for someone to tackle perhaps.)

(Very cool package @Ronis_BR.)

---

<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, 6:27pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/44 "2021-04-19T18:27:30Z")

</div>

> [@Ronis\_BR](#):
>
> @giordano btw, would CTRL solve your problem? Like CTRL + arrows? I can make a switch to use CTRL instead SHIFT to modify the “speed”.

I think Ctrl + arrows is available in Konsole. I think a customisable switch for the user would be great, I can expect different terminal emulators have different keybindings. Thanks!

---

<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, 11:28pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/45 "2021-04-19T23:28:57Z")

</div>

> [@giordano](#):
>
> I think Ctrl + arrows is available in Konsole. I think a customisable switch for the user would be great, I can expect different terminal emulators have different keybindings. Thanks!

I wasn’t expecting these kind of problems. Different terminal apps select some key codes that are not passed to the application. Does anyone know if there is a global option to avoid this and receive all the key codes ? In macOS Terminal.app, Page Up scroll the screen up (the screen itself, not the pager). However, `less` seems to fix it somehow. I need to discover how it can be done.

---

<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 20, 2021, 1:07am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/46 "2021-04-20T01:07:51Z")

</div>

> [@giordano](#):
>
> I think Ctrl + arrows is available in Konsole. I think a customisable switch for the user would be great, I can expect different terminal emulators have different keybindings. Thanks!

Can you please test `main` branch? I just push a commit with a WIP keybinding systems:

```julia
julia> using TerminalPager

julia> TerminalPager.set_keybinding(:right, alt = true, :fastright)

julia> TerminalPager.set_keybinding(:left, alt = true, :fastleft)

julia> TerminalPager.set_keybinding(:up, alt = true, :fastup)

julia> TerminalPager.set_keybinding(:down, alt = true, :fastdown)

julia> rand(100,100) |> pager

```

And now you can move fast in all directions using ALT + arrows. If you want CTRL change `alt` keyword to `ctrl` (I could not test it because my OS hijack CTRL + arrow)

---

<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 20, 2021, 1:21am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/47 "2021-04-20T01:21:09Z")

</div>

`Ctrl` works for me, `Alt` doesn’t, thanks! (the help still mentions Shift though)

---

<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 20, 2021, 2:10am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/48 "2021-04-20T02:10:59Z")

</div>

Yes, I did not add the code to change help according to the custom user definitions yet. Thanks for the feedback!!

---

<div class="post-metadata">

**Author:** ![carlomontec](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carlomontec/32/2011_2.png) [@carlomontec](https://discourse.julialang.org/u/carlomontec)\
**Post date:** [April 21, 2021, 10:28am UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/49 "2021-04-21T10:28:44Z")

</div>

nice! Seems I was not the only one wondering that option 🙂[Print DataFrame as "less"-command style](https://discourse.julialang.org/t/print-dataframe-as-less-command-style/40667)

---

<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:** [April 21, 2021, 12:54pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/50 "2021-04-21T12:54:10Z")

</div>

> [@Ronis\_BR](#):
>
> 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 🙂

I think it would already be a significant improvement over the current (default) `@less` implementation, which periodically [crashes](https://github.com/JuliaLang/julia/issues/36379) my REPL 🙂

---

<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 21, 2021, 1:09pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/51 "2021-04-21T13:09:50Z")

</div>

Does `TerminalPager.jl` support control chars like colours? That’d be important for stuff like docstrings

---

<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 21, 2021, 1:31pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561/52 "2021-04-21T13:31:45Z")

</div>

> [@carlomontec](#):
>
> nice! Seems I was not the only one wondering that option 🙂 [Print DataFrame as “less”-command style](https://discourse.julialang.org/t/print-dataframe-as-less-command-style/40667)

Nice! 🙂

> [@sijo](#):
>
> I think it would already be a significant improvement over the current (default) `@less` implementation, which periodically [crashes](https://github.com/JuliaLang/julia/issues/36379) my REPL 🙂

It also crashes a lot here. I tried that before coding this package.

> [@giordano](#):
>
> Does `TerminalPager.jl` support control chars like colours? That’d be important for stuff like docstrings

Yes! In fact, handling escape sequences are a major challenge. Right now, I am not processing them to verify which one must be applied when cropping the screen, I am just writing all. See for example the documentation of `pretty_table` cropped:

 ![Captura de Tela 2021-04-21 às 10.30.19](https://global.discourse-cdn.com/julialang/original/3X/8/9/893ab127404cce2e8008d11f1de119dc183966f7.png)

Some of color control sequences are placed before the left most column. Nevertheless, the color is still right.

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