Sha256: 645d5f3100647f6f333f4b0b2308354dcff45c77241cdc5d7fa855fdc79958ad

Contents?: true

Size: 790 Bytes

Versions: 6

Compression:

Stored size: 790 Bytes

Contents

# frozen_string_literal: true

class Pry
  class Command
    class ShellMode < Pry::ClassCommand
      match 'shell-mode'
      group 'Input and Output'
      description 'Toggle shell mode. Bring in pwd prompt and file completion.'
      command_options state: %i[disabled prev_prompt]

      banner <<-'BANNER'
        Toggle shell mode. Bring in pwd prompt and file completion.
      BANNER

      def process
        state.disabled ^= true

        if state.disabled
          state.prev_prompt = pry_instance.prompt
          pry_instance.prompt = Pry::Prompt[:shell]
        else
          pry_instance.prompt = state.prev_prompt
        end
      end
    end

    Pry::Commands.add_command(Pry::Command::ShellMode)
    Pry::Commands.alias_command 'file-mode', 'shell-mode'
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pry-0.15.2 lib/pry/commands/shell_mode.rb
pry-0.15.2-java lib/pry/commands/shell_mode.rb
pry-0.15.1 lib/pry/commands/shell_mode.rb
pry-0.15.1-java lib/pry/commands/shell_mode.rb
pry-0.15.0 lib/pry/commands/shell_mode.rb
pry-0.15.0-java lib/pry/commands/shell_mode.rb