class DEBUGGER__::ThreadClient

def show_by_editor path = nil

def show_by_editor path = nil
  unless path
    if current_frame
      path = current_frame.path
    else
      return # can't get path
    end
  end
  if File.exist?(path)
    if editor = (ENV['RUBY_DEBUG_EDITOR'] || ENV['EDITOR'])
      puts "command: #{editor}"
      puts "   path: #{path}"
      require 'shellwords'
      system(*Shellwords.split(editor), path)
    else
      puts "can not find editor setting: ENV['RUBY_DEBUG_EDITOR'] or ENV['EDITOR']"
    end
  else
    puts "Can not find file: #{path}"
  end
end