mirror of
				https://github.com/alacritty/alacritty.git
				synced 2025-10-30 23:36:53 -04:00 
			
		
		
		
	Fix saved cursor handling
This resolves several problems with handling of the saved cursor when switching between primary and alternate screen. Additionally ref-tests are also added for all common interactions to make sure the behavior does not regress. The behavior is based on XTerm's behavior except for interaction with `reset`. XTerm does not reset the alternate screen's saved cursor on `reset`, but VTE does. Since a `reset` should reset as much as possible, Alacritty copies VTE here instead of XTerm.
This commit is contained in:
		
							parent
							
								
									72c916ff43
								
							
						
					
					
						commit
						65bff1878f
					
				
					 11 changed files with 28 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
[undeadleech@archhq saved_cursor]$ echo -e "\e7 \e(0 test \e8 xxx"
 | 
			
		||||
7 (0 test 8 xxx
 | 
			
		||||
[undeadleech@archhq saved_cursor]$ echo -e "\e[?1049h \e(0 test \e[?1049l xxx"
 | 
			
		||||
[?1049h (0 test [?1049l xxx
 | 
			
		||||
[undeadleech@archhq saved_cursor]$ echo -e "\e7 \e(0 \e[?1049h test \e[?1049l \e8 xxx"
 | 
			
		||||
7 (0 [?1049h test [?1049l 8 xxx
 | 
			
		||||
[undeadleech@archhq saved_cursor]$ exit
 | 
			
		||||
exit
 | 
			
		||||
							
								
								
									
										1
									
								
								alacritty_terminal/tests/ref/saved_cursor/config.json
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								alacritty_terminal/tests/ref/saved_cursor/config.json
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
{"history_size":0}
 | 
			
		||||
							
								
								
									
										1
									
								
								alacritty_terminal/tests/ref/saved_cursor/grid.json
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								alacritty_terminal/tests/ref/saved_cursor/grid.json
									
										
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										1
									
								
								alacritty_terminal/tests/ref/saved_cursor/size.json
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								alacritty_terminal/tests/ref/saved_cursor/size.json
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
{"width":1259.0,"height":683.0,"cell_width":9.0,"cell_height":19.0,"padding_x":4.0,"padding_y":9.0,"dpr":1.1666666666666667}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
[undeadleech@archhq saved_cursor_alt]$ echo -e "\e(0\e[10;$(tput cols)H \e[?1049h\e7 \e[?1049l \e(B\e[H \e[?1049h test\e8xxx"
 | 
			
		||||
(0[10;139H [?1049h7 [?1049l (B[H [?1049h test8xxx
 | 
			
		||||
[undeadleech@archhq saved_cursor_alt]$ exit
 | 
			
		||||
exit
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
{"history_size":0}
 | 
			
		||||
							
								
								
									
										1
									
								
								alacritty_terminal/tests/ref/saved_cursor_alt/grid.json
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								alacritty_terminal/tests/ref/saved_cursor_alt/grid.json
									
										
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										1
									
								
								alacritty_terminal/tests/ref/saved_cursor_alt/size.json
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								alacritty_terminal/tests/ref/saved_cursor_alt/size.json
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
{"width":1259.0,"height":683.0,"cell_width":9.0,"cell_height":19.0,"padding_x":4.0,"padding_y":9.0,"dpr":1.1666666666666667}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue