<commit_before>require 'byebug/history'

module Byebug
  #
  # Interface class for remote use of byebug.
  #
  class RemoteInterface < Interface
    attr_reader :history

    def initialize(socket)
      super()
      @socket = socket
      @history = History.new
    end

    def close
      @socket.close
    rescue IOError
    end

    def confirm(prompt)
      send_command "CONFIRM #{prompt}"
    end

    def read_command(prompt)
      send_command "PROMPT #{prompt}"
    end

    def puts(message)
      @socket.printf(message)
    end

    private

    def send_command(msg)
      @socket.puts msg
      result = @socket.gets
      fail IOError unless result
      result.chomp
    end
  end
end<commit_msg>Fix yet another issue recently in remote debugging<commit_after>require 'byebug/history'

module Byebug
  #
  # Interface class for remote use of byebug.
  #
  class RemoteInterface < Interface
    attr_reader :history

    def initialize(socket)
      super()
      @socket = socket
      @history = History.new
    end

    def close
      @socket.close
    rescue IOError
    end

    def confirm(prompt)
      send_command "CONFIRM #{prompt}"
    end

    def read_command(prompt)
      send_command "PROMPT #{prompt}"
    end

    def puts(message)
      @socket.puts(message)
    end

    private

    def send_command(msg)
      @socket.puts msg
      result = @socket.gets
      fail IOError unless result
      result.chomp
    end
  end
end
{'fraction_non_alphanumeric': 0.0696245733788396, 'fraction_numerical': 0.0, 'mean_word_length': 2.286995515695067, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7379337', 'n_tokens_mistral': 460, 'n_tokens_neox': 438, 'n_words': 128}