def apply_code!(letter, *pars)
			case letter
			when 'J'
				cur_col = @cursor.cur_col
				cur_row = @cursor.cur_row
				lines = @screens[-1].lines
				if pars.empty? or 0 == pars[0]
					rs = lines.keys.select{|r| r > cur_row}
					cs = lines[cur_row].keys.select{|c| c >= cur_col}
				elsif 1 == pars[0]
					rs = lines.keys.select{|r| r < cur_row}
					cs = lines[cur_row].keys.select{|c| c <= cur_col}
				elsif 2 == pars[0]
					rs = lines.keys
					cs = []
					@cursor.apply_code!('H', 1, 1)
				end
				rs.each do |r|
					lines.delete(r)
				end
				cs.each do |c|
					lines[cur_row].delete(c)
				end
			when 'K'
				cur_col = @cursor.cur_col
				cur_row = @cursor.cur_row
				line = @screens[-1].lines[cur_row]
				if pars.empty? or 0 == pars[0]
					cs = line.keys.select{|c| c >= cur_col}
				elsif 1 == pars[0]
					cs = line.keys.select{|c| c <= cur_col}
				elsif 2 == pars[0]
					cs = line.keys
				end
				cs.each do |c|
					line.delete(c)
				end
			when 'S'
				lines = @screens[-1].lines
				n = pars.empty? ? 1 : pars[0]
				n.times do |l|
					lines.delete(l)
				end
				rs = lines.keys.sort
				rs.each do |r|
					lines[r-n] = lines[r]
					lines.delete(r)
				end
				@cursor.apply_code!('H', rs[-1] - n + 1, 1)
			when 'T'
				lines = @screens[-1].lines
				n = pars.empty? ? 1 : pars[0]
				rs = lines.keys.sort_by{|a| -a}	# sort.reverse
				rs.each do |r|
					lines[r+n] = lines[r]
					lines.delete(r)
				end
				@cursor.apply_code!('H', rs[-1] - n + 1, 1)
			when 's'
				@stored_cursor = @cursor.dup
			when 'u'
				@cursor = @stored_cursor.dup if @stored_cursor
			end

			return self
		end
def apply_code!(letter, *pars)
			case letter
			when 'J'
				cur_col = @cursor.cur_col
				cur_row = @cursor.cur_row
				lines = @screens[-1].lines
				if pars.empty? or 0 == pars[0]
					rs = lines.keys.select{|r| r > cur_row}
					cs = lines[cur_row].keys.select{|c| c >= cur_col}
				elsif 1 == pars[0]
					rs = lines.keys.select{|r| r < cur_row}
					cs = lines[cur_row].keys.select{|c| c <= cur_col}
				elsif 2 == pars[0]
					rs = lines.keys
					cs = []
					@cursor.apply_code!('H', 1, 1)
				end
				rs.each do |r|
					lines.delete(r)
				end
				cs.each do |c|
					lines[cur_row].delete(c)
				end
			when 'K'
				cur_col = @cursor.cur_col
				cur_row = @cursor.cur_row
				line = @screens[-1].lines[cur_row]
				if pars.empty? or 0 == pars[0]
					cs = line.keys.select{|c| c >= cur_col}
				elsif 1 == pars[0]
					cs = line.keys.select{|c| c <= cur_col}
				elsif 2 == pars[0]
					cs = line.keys
				end
				cs.each do |c|
					line.delete(c)
				end
			when 'S'
				lines = @screens[-1].lines
				n = pars.empty? ? 1 : pars[0]
				n.times do |l|
					lines.delete(l)
				end
				rs = lines.keys.sort
				rs.each do |r|
					lines[r-n] = lines[r]
					lines.delete(r)
				end
				@cursor.apply_code!('H', rs[-1] - n + 1, 1)
			when 'T'
				lines = @screens[-1].lines
				n = pars.empty? ? 1 : pars[0]
				rs = lines.keys.sort_by{|a| -a}	# sort.reverse
				rs.each do |r|
					lines[r+n] = lines[r]
					lines.delete(r)
				end
				@cursor.apply_code!('H', rs[-1] - n + 1, 1)
			when 's'
				@stored_cursor = @cursor.dup
			when 'u'
				@cursor = @stored_cursor.dup if @stored_cursor
			end

			return self
		end
applies self an escape sequence code that ends with _letter_ as String
 and with some _pars_ as Integers