New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-Visible Characters Printed with Pager #2185
Comments
It's definitely related to the pager. When there's no page, no |
Is there any workaround? |
@justin808, I've been using |
Unfortunately, in Windows, disabling the pager doesn't seem to work against removing the extra characters. |
Fixes #2185 (Non-Visible Characters Printed with Page) The `--raw-control-chars` option (aka `-r`) does the following: ``` Causes "raw" control characters to be displayed. The default is to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the -r option is used, less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various dis- play problems may result, such as long lines being split in the wrong place. ``` The `--RAW-CONTROL-CHARS` option was always used with the pager, I just expanded it from `-R`, so that it looks more descriptive. For reference, it does the following: ``` Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained cor- rectly in most cases. ANSI "color" escape sequences are sequences of the form: ESC [ ... m where the "..." is zero or more color specification characters For the purpose of keeping track of screen appearance, ANSI color escape sequences are assumed to not move the cursor. You can make less think that characters other than "m" can end ANSI color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape sequence. And you can make less think that characters other than the standard ones may appear between the ESC and the m by setting the environment variable LESSANSIMIDCHARS to the list of characters which can appear. ```
I published #2207 which should fix the problem. Could you guys give it a try before I merge? I just want to make sure it will consistently work for everyone.
|
I've also pushed a version in #2209 that takes a different approach. |
Fixes #2185 (Non-Visible Characters Printed with Page) The `--raw-control-chars` option (aka `-r`) does the following: ``` Causes "raw" control characters to be displayed. The default is to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the -r option is used, less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various dis- play problems may result, such as long lines being split in the wrong place. ``` The `--RAW-CONTROL-CHARS` option was always used with the pager, I just expanded it from `-R`, so that it looks more descriptive. For reference, it does the following: ``` Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained cor- rectly in most cases. ANSI "color" escape sequences are sequences of the form: ESC [ ... m where the "..." is zero or more color specification characters For the purpose of keeping track of screen appearance, ANSI color escape sequences are assumed to not move the cursor. You can make less think that characters other than "m" can end ANSI color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape sequence. And you can make less think that characters other than the standard ones may appear between the ESC and the m by setting the environment variable LESSANSIMIDCHARS to the list of characters which can appear. ```
Had the same issue with Looking at #2207 made me come up with a workaround someone can use while this is still not merged. Adding the following to your ENV['PAGER'] = ' less --raw-control-chars -F -X' Note the leading space - pager = "less -R -F -X" if pager.strip.empty? || pager =~ /^less\b/ |
I see, so what adds the escapes is #2207 tries to fix this by using #2209 supposedly addresses the other issue, where An obvious solution is to simply not add Workarounds:
|
PR #2154 seems to have a regression where non-visible characters are being printed when using a pager. Below are the differences between
v0.14.0
andv0.14.1
. I'm using Terminal (Version 2.11 (440)
) on macOS (11.2.3 (20D91)
) and I've tested this with the system version of less (v487
) and as well as the latest (v563
)Pry v0.14.1 (current)
Pry v0.14.0 (previous)
The text was updated successfully, but these errors were encountered: