summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md3
-rw-r--r--lib/pry/pager.rb8
2 files changed, 8 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 65ec4029..9644ec38 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,9 @@
* Fixed bug where reading from the `_out_` sticky local variable could return
wrong results ([#2201](https://github.com/pry/pry/pull/2201))
+* Fixed bug where paged output can erroneously display non-visible control
+ characters (`\001` aka `^A` & `\002` aka `^B`)
+ ([#2207](https://github.com/pry/pry/pull/2207))
### [v0.14.1][v0.14.1] (April 12, 2021)
diff --git a/lib/pry/pager.rb b/lib/pry/pager.rb
index e6e40898..fba881bc 100644
--- a/lib/pry/pager.rb
+++ b/lib/pry/pager.rb
@@ -8,6 +8,9 @@ class Pry
class StopPaging < StandardError
end
+ # @return [String] the 'less' executable and its options
+ LESS_PAGER = 'less --RAW-CONTROL-CHARS --raw-control-chars -F -X'
+
attr_reader :pry_instance
def initialize(pry_instance)
@@ -130,9 +133,8 @@ class Pry
def self.default_pager
pager = Pry::Env['PAGER'] || ''
- # Default to less, and make sure less is being passed the correct
- # options
- pager = "less -R -F -X" if pager.strip.empty? || pager =~ /^less\b/
+ # Default to less.
+ pager = LESS_PAGER if pager.strip.empty? || pager =~ /^less\b/
pager
end