summaryrefslogtreecommitdiff
path: root/lib/pry/commands/shell_mode.rb
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2018-11-03 21:58:16 +0800
committerKyrylo Silin <silin@kyrylo.org>2018-11-03 22:08:52 +0800
commit82d683b146094dec1ac4dc09f56208df2e1dde7e (patch)
tree0927e5b3267667d19ee95b262aed68e489f4a154 /lib/pry/commands/shell_mode.rb
parent98c5e95064524a603dbaef03c94c97a6b665b9c2 (diff)
downloadpry-prompt-api.tar.gz
prompt: add basic API for adding promptsprompt-api
Fixes #1836 (Add an API for adding new prompts)
Diffstat (limited to 'lib/pry/commands/shell_mode.rb')
-rw-r--r--lib/pry/commands/shell_mode.rb10
1 files changed, 4 insertions, 6 deletions
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