Skip to content

Commit

Permalink
Add Reline autocompletion prompt behind a feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanusz-r7 committed Aug 20, 2024
1 parent c933222 commit 9591233
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/msf/core/feature_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class FeatureManager
MSSQL_SESSION_TYPE = 'mssql_session_type'
LDAP_SESSION_TYPE = 'ldap_session_type'
SHOW_SUCCESSFUL_LOGINS = 'show_successful_logins'
SHOW_AUTOCOMPLETION_PROMPT = 'show_autocompletion_prompt'

DEFAULTS = [
{
Expand Down Expand Up @@ -124,6 +125,13 @@ class FeatureManager
requires_restart: false,
default_value: true,
developer_notes: 'Enabled in Metasploit 6.4.x'
}.freeze,
{
name: SHOW_AUTOCOMPLETION_PROMPT,
description: 'When enabled, an autocompletion prompt will be shown when typing in commands',
requires_restart: true,
default_value: false,
developer_notes: 'To be enabled once the Readline to Reline upgrade has been confirmed to not cause issues'
}.freeze
].freeze

Expand Down
4 changes: 4 additions & 0 deletions lib/rex/ui/text/shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def run(&block)
# Pry is a development dependency, if not available suppressing history_load can be safely ignored.
end

if framework.features.enabled?(Msf::FeatureManager::SHOW_AUTOCOMPLETION_PROMPT)
Reline.autocompletion = true
end

with_history_manager_context do
begin
while true
Expand Down

0 comments on commit 9591233

Please sign in to comment.