Land #10755, 50, it's a magic number (sorry 2)

4.x
Brent Cook 2018-10-05 15:04:20 -05:00 committed by Metasploit
parent f6a75c8328
commit 342f3b9637
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
1 changed files with 13 additions and 4 deletions

View File

@ -28,11 +28,19 @@ class Msf::Ui::Console::CommandDispatcher::Developer
end end
def local_editor def local_editor
framework.datastore['LocalEditor'] || Rex::Compat.getenv('VISUAL') || Rex::Compat.getenv('EDITOR') framework.datastore['LocalEditor'] ||
Rex::Compat.getenv('VISUAL') ||
Rex::Compat.getenv('EDITOR') ||
Msf::Util::Helper.which('vim') ||
Msf::Util::Helper.which('vi')
end end
def local_pager def local_pager
framework.datastore['LocalPager'] || Rex::Compat.getenv('PAGER') || Rex::Compat.getenv('MANPAGER') framework.datastore['LocalPager'] ||
Rex::Compat.getenv('PAGER') ||
Rex::Compat.getenv('MANPAGER') ||
Msf::Util::Helper.which('less') ||
Msf::Util::Helper.which('more')
end end
# XXX: This will try to reload *any* .rb and break on modules # XXX: This will try to reload *any* .rb and break on modules
@ -199,7 +207,8 @@ class Msf::Ui::Console::CommandDispatcher::Developer
editor = local_editor editor = local_editor
unless editor unless editor
editor = 'vim' # ed(1) is the standard editor
editor = 'ed'
print_warning("LocalEditor or $VISUAL/$EDITOR should be set. Falling back on #{editor}.") print_warning("LocalEditor or $VISUAL/$EDITOR should be set. Falling back on #{editor}.")
end end
@ -283,7 +292,7 @@ class Msf::Ui::Console::CommandDispatcher::Developer
pager = local_pager.to_s.include?('less') ? "#{local_pager} +G" : local_pager pager = local_pager.to_s.include?('less') ? "#{local_pager} +G" : local_pager
unless pager unless pager
pager = 'tail -n 24' pager = 'tail -n 50'
print_warning("LocalPager or $PAGER/$MANPAGER should be set. Falling back on #{pager}.") print_warning("LocalPager or $PAGER/$MANPAGER should be set. Falling back on #{pager}.")
end end