# File lib/hammer_cli/shell.rb, line 82
    def execute
      ShellMainCommand.load_commands(HammerCLI::MainCommand)

      if RUBY_VERSION >= "1.9"
        Readline.completion_append_character = ''
        Readline.completer_word_break_characters = ' ='
        Readline.completion_proc = complete_proc
      else
        Readline.completion_proc = lambda {}
      end

      stty_save = `stty -g`.chomp

      history = ShellHistory.new(Settings.get(:ui, :history_file) || DEFAULT_HISTORY_FILE)

      begin
        print_welcome_message
        while line = Readline.readline(prompt)

          history.push(line)

          line = HammerCLI::CompleterLine.new(line)
          ShellMainCommand.run('', line, context) unless line.empty?
        end
      rescue Interrupt; end

      puts
      system('stty', stty_save) # Restore
      HammerCLI::EX_OK
    end