mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:12:45 +00:00 
			
		
		
		
	Terminal: Add support for DCH ('P' final)
Patch contributed by "pd"
This commit is contained in:
		
							parent
							
								
									16f624421a
								
							
						
					
					
						commit
						42f374d0f1
					
				
					 2 changed files with 26 additions and 0 deletions
				
			
		|  | @ -533,6 +533,28 @@ void Terminal::escape$M(const ParamVector& params) | |||
|     } | ||||
| } | ||||
| 
 | ||||
| void Terminal::escape$P(const ParamVector& params) | ||||
| { | ||||
|     int num = 1; | ||||
|     if (params.size() >= 1) | ||||
|         num = params[0]; | ||||
| 
 | ||||
|     if (num == 0) | ||||
|         num = 1; | ||||
| 
 | ||||
|     auto& line = this->line(m_cursor_row); | ||||
| 
 | ||||
|     // Move n characters of line to the left
 | ||||
|     for (int i = m_cursor_column; i < line.m_length - num; i++) | ||||
|         line.characters[i] = line.characters[i + num]; | ||||
| 
 | ||||
|     // Fill remainder of line with blanks
 | ||||
|     for (int i = line.m_length - num; i < line.m_length; i++) | ||||
|         line.characters[i] = ' '; | ||||
| 
 | ||||
|     line.dirty = true; | ||||
| } | ||||
| 
 | ||||
| void Terminal::execute_xterm_command() | ||||
| { | ||||
|     m_final = '@'; | ||||
|  | @ -611,6 +633,9 @@ void Terminal::execute_escape_sequence(byte final) | |||
|     case 'M': | ||||
|         escape$M(params); | ||||
|         break; | ||||
|     case 'P': | ||||
|         escape$P(params); | ||||
|         break; | ||||
|     case 'S': | ||||
|         escape$S(params); | ||||
|         break; | ||||
|  |  | |||
|  | @ -61,6 +61,7 @@ private: | |||
|     void escape$J(const ParamVector&); | ||||
|     void escape$K(const ParamVector&); | ||||
|     void escape$M(const ParamVector&); | ||||
|     void escape$P(const ParamVector&); | ||||
|     void escape$G(const ParamVector&); | ||||
|     void escape$X(const ParamVector&); | ||||
|     void escape$b(const ParamVector&); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling