def frame
      return @frame if @frame

      chars = []
      # 4 corners
      chars << Char.new(0x23, @x_offset - 1, @y_offset - 1)               # TopLeft
      chars << Char.new(0x23, @x_offset + @width, @y_offset - 1)          # TopRight
      chars << Char.new(0x23, @x_offset - 1, @y_offset + @height)         # BottomLeft
      chars << Char.new(0x23, @x_offset + @width, @y_offset  + @height)   # BottomRight

      # horiz
      @width.times { |x| chars << Char.new(0x2d, x + @x_offset, @y_offset - 1) }
      @width.times { |x| chars << Char.new(0x2d, x + @x_offset, @y_offset + @height) }

      # vertical
      @height.times { |y| chars << Char.new(0x7c, @x_offset - 1, y + @y_offset) }
      @height.times { |y| chars << Char.new(0x7c, @x_offset + @width, y + @y_offset) }
      @frame = ""
      @frame << chars.join
    end
def frame
      return @frame if @frame

      chars = []
      # 4 corners
      chars << Char.new(0x23, @x_offset - 1, @y_offset - 1)               # TopLeft
      chars << Char.new(0x23, @x_offset + @width, @y_offset - 1)          # TopRight
      chars << Char.new(0x23, @x_offset - 1, @y_offset + @height)         # BottomLeft
      chars << Char.new(0x23, @x_offset + @width, @y_offset  + @height)   # BottomRight

      # horiz
      @width.times { |x| chars << Char.new(0x2d, x + @x_offset, @y_offset - 1) }
      @width.times { |x| chars << Char.new(0x2d, x + @x_offset, @y_offset + @height) }

      # vertical
      @height.times { |y| chars << Char.new(0x7c, @x_offset - 1, y + @y_offset) }
      @height.times { |y| chars << Char.new(0x7c, @x_offset + @width, y + @y_offset) }
      @frame = ""
      @frame << chars.join
    end
Use a fancy border around console