From 82d683b146094dec1ac4dc09f56208df2e1dde7e Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Sat, 3 Nov 2018 21:58:16 +0800 Subject: prompt: add basic API for adding prompts Fixes #1836 (Add an API for adding new prompts) --- lib/pry/commands/shell_mode.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/pry/commands/shell_mode.rb') diff --git a/lib/pry/commands/shell_mode.rb b/lib/pry/commands/shell_mode.rb index 0e5fd0bd..429da7ad 100644 --- a/lib/pry/commands/shell_mode.rb +++ b/lib/pry/commands/shell_mode.rb @@ -9,13 +9,11 @@ class Pry BANNER def process - case _pry_.prompt - when Pry::Prompt::SHELL - _pry_.pop_prompt - _pry_.custom_completions = _pry_.config.file_completions + if state.disabled ^= true + state.prev_prompt = _pry_.prompt + _pry_.prompt = Pry::Prompt[:shell][:value] else - _pry_.push_prompt Pry::Prompt::SHELL - _pry_.custom_completions = _pry_.config.command_completions + _pry_.prompt = state.prev_prompt end end end -- cgit v1.2.1