# File lib/rbreadline.rb, line 6947
  def prepare_terminal_settings(meta_flag)
    retry_if_interrupted do
      @readline_echoing_p = (`stty -a`.scan(/-*echo\b/).first == 'echo')
    end

    # First, the basic settings to put us into character-at-a-time, no-echo
    #   input mode.
    setting = " -echo -icrnl cbreak"

    # If this terminal doesn't care how the 8th bit is used, then we can
    #   use it for the meta-key.  If only one of even or odd parity is
    #  specified, then the terminal is using parity, and we cannot.
    retry_if_interrupted do
      if (`stty -a`.scan(/-parenb\b/).first == '-parenb')
        setting << " pass8"
      end
    end

    setting << " -ixoff"

    rl_bind_key(@_rl_tty_chars.t_start, :rl_restart_output)
    @_rl_eof_char = @_rl_tty_chars.t_eof

    #setting << " -isig"

    retry_if_interrupted do
      `stty #{setting}`
    end
  end