ronisbr / TerminalPager.jl

Pure Julia implementation of the command less
MIT License
116 stars 8 forks source link

pager?> mode is limited to 80 columns, unlike help?> mode #25

Closed Ratfink closed 1 year ago

Ratfink commented 1 year ago

Using TerminalPager 0.3.1 with Julia 1.8.2, the pager?> mode limits the output to 80 columns, instead of taking the full terminal width as in the built-in help?> mode. See below for an example. Of course, one reason for using a pager is to have less scrollback in one's terminal, so it would be nice for pager?> to give the same behavior in this case.

pager?> run
search: run trunc truncate round rounding RoundUp baltrunc RoundDown RoundToZero

  run(command, args...; wait::Bool = true)

  Run a command object, constructed with backticks (see the Running External
  Programs section in the manual). Throws an error if anything goes wrong,
  including the process exiting with a non-zero status (when wait is true).

  The args... allow you to pass through file descriptors to the command, and
  are ordered like regular unix file descriptors (eg stdin, stdout, stderr,
  FD(3), FD(4)...).

  If wait is false, the process runs asynchronously. You can later wait for it
  and check its exit status by calling success on the returned process object.

  When wait is false, the process' I/O streams are directed to devnull. When
  wait is true, I/O streams are shared with the parent process. Use pipeline
  to control I/O redirection.

help?> run
search: run trunc truncate round rounding RoundUp baltrunc RoundDown RoundToZero RoundingMode RoundNearest

  run(command, args...; wait::Bool = true)

  Run a command object, constructed with backticks (see the Running External Programs section in the manual). Throws
  an error if anything goes wrong, including the process exiting with a non-zero status (when wait is true).

  The args... allow you to pass through file descriptors to the command, and are ordered like regular unix file
  descriptors (eg stdin, stdout, stderr, FD(3), FD(4)...).

  If wait is false, the process runs asynchronously. You can later wait for it and check its exit status by calling
  success on the returned process object.

  When wait is false, the process' I/O streams are directed to devnull. When wait is true, I/O streams are shared
ronisbr commented 1 year ago

Hi @Ratfink !

Thanks for the suggestion. I think we may inherit the context data from stdout. I just need to see if we will have edge cases.

ronisbr commented 1 year ago

Hi @Ratfink!

I pushed a commit to main that should fix this bug. Can you please test before I tag a new version?

Ratfink commented 1 year ago

Thanks! It looks like it's fixed to me, with the pager-ified help filling the whole terminal width for both long and short help text.

ronisbr commented 1 year ago

Perfect! I will fix some other problems and release a new version.