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 Nov 18, 2024
1 parent acc9940 commit 848811e
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 @@ -29,6 +29,7 @@ class FeatureManager
LDAP_SESSION_TYPE = 'ldap_session_type'
SHOW_SUCCESSFUL_LOGINS = 'show_successful_logins'
DISPLAY_MODULE_ACTION = 'display_module_action'
SHOW_AUTOCOMPLETION_PROMPT = 'show_autocompletion_prompt'

DEFAULTS = [
{
Expand Down Expand Up @@ -132,6 +133,13 @@ class FeatureManager
requires_restart: false,
default_value: true,
developer_notes: 'Added as a feature so users can turn it off if they wish to reduce clutter in their terminal'
}.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 @@ -130,6 +130,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 848811e

Please sign in to comment.