summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/init.rb3
-rw-r--r--lib/irb/lc/help-message1
-rw-r--r--lib/irb/pager.rb2
3 files changed, 5 insertions, 1 deletions
diff --git a/lib/irb/init.rb b/lib/irb/init.rb
index 4df285ce64..9704e36cb1 100644
--- a/lib/irb/init.rb
+++ b/lib/irb/init.rb
@@ -82,6 +82,7 @@ module IRB # :nodoc:
@CONF[:USE_LOADER] = false
@CONF[:IGNORE_SIGINT] = true
@CONF[:IGNORE_EOF] = false
+ @CONF[:USE_PAGER] = true
@CONF[:EXTRA_DOC_DIRS] = []
@CONF[:ECHO] = nil
@CONF[:ECHO_ON_ASSIGNMENT] = nil
@@ -285,6 +286,8 @@ module IRB # :nodoc:
end
when "--noinspect"
@CONF[:INSPECT_MODE] = false
+ when "--no-pager"
+ @CONF[:USE_PAGER] = false
when "--singleline", "--readline", "--legacy"
@CONF[:USE_SINGLELINE] = true
when "--nosingleline", "--noreadline"
diff --git a/lib/irb/lc/help-message b/lib/irb/lc/help-message
index c7846b755d..37347306e8 100644
--- a/lib/irb/lc/help-message
+++ b/lib/irb/lc/help-message
@@ -22,6 +22,7 @@ Usage: irb.rb [options] [programfile] [arguments]
Show truncated result on assignment (default).
--inspect Use 'inspect' for output.
--noinspect Don't use 'inspect' for output.
+ --no-pager Don't use pager.
--multiline Use multiline editor module (default).
--nomultiline Don't use multiline editor module.
--singleline Use single line editor module.
diff --git a/lib/irb/pager.rb b/lib/irb/pager.rb
index 119515078b..e38d97e3c7 100644
--- a/lib/irb/pager.rb
+++ b/lib/irb/pager.rb
@@ -18,7 +18,7 @@ module IRB
end
def page
- if STDIN.tty? && pager = setup_pager
+ if IRB.conf[:USE_PAGER] && STDIN.tty? && pager = setup_pager
begin
pid = pager.pid
yield pager