[ANN] Announcing TerminalPager.jl

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

1 Like

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

4 Likes

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.)

4 Likes

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!

2 Likes

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.

1 Like

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

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)

3 Likes

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

1 Like

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

nice! Seems I was not the only one wondering that option :slight_smile: Print DataFrame as "less"-command style

I think it would already be a significant improvement over the current (default) @less implementation, which periodically crashes my REPL :slight_smile:

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

Nice! :slight_smile:

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

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:

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

4 Likes