summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2017-08-09 13:22:07 -0500
committerJoe Wilm <jwilm@users.noreply.github.com>2017-08-11 08:29:56 -0700
commitf041ce0f59ab52bedae963b6fb2666b6e97f6455 (patch)
tree7a2cc1bd3827b7fa928c11b7e9e834530288b389 /tests
parent11af896734354257a5491f67789fc59182e0c6b1 (diff)
Fix BCE issues affecting vim
Now pass more vttests as well. Resolves #123 cc #660 - screenshot there exhibited the problem, but issue is not entirely about the background problem.
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/vim_large_window_scroll/alacritty.recording1219
-rw-r--r--tests/ref/vim_large_window_scroll/grid.json2
-rw-r--r--tests/ref/vim_large_window_scroll/size.json2
3 files changed, 979 insertions, 244 deletions
diff --git a/tests/ref/vim_large_window_scroll/alacritty.recording b/tests/ref/vim_large_window_scroll/alacritty.recording
index 115a33cd..2da4636f 100644
--- a/tests/ref/vim_large_window_scroll/alacritty.recording
+++ b/tests/ref/vim_large_window_scroll/alacritty.recording
@@ -1,242 +1,977 @@
-% ]2;jwilm@jwilm-desk: ~/code/alacritty]1;..ode/alacritty jwilm@jwilm-desk ➜  ~/code/alacritty  [?1h=[?2004hvvivim ssrrcc//mmaaiinn.rs  [?1l>[?2004l
-]2;vim src/main.rs]1;vim[?1049h[?1h=▽ [?12;25h[?12l[?25h[?25l"src/main.rs" 188L, 6109C145  let io_thread = event_loop.spawn(None); 
-146  
-147  // Main display loop 
-148  loop { 
-149 // Process input and window events 
-150 let mut terminal = processor.process_events(&terminal, display.window()); 
-151  
-152 // Handle config reloads 
-153 config_monitor.as_ref() 
-154 .and_then(|monitor| monitor.pending_config()) 
-155 .map(|new_config| { 
-156 config = new_config; 
-157 display.update_config(&config); 
-158 processor.update_config(&config); 
-159 terminal.update_config(&config); 
-160 terminal.dirty = true; 
-161 }); 
-162  
-163 // Maybe draw the terminal 
-164 if terminal.needs_draw() { 
-165 // Handle pending resize events 
-166 // 
-167 // The second argument is a list of types that want to be notified 
-168 // of display size changes. 
-169 display.handle_resize(&mut terminal, &mut [&mut pty, &mut processor]); 
-170  
-171 // Draw the current state of the terminal 
-172 display.draw(terminal, &config, &processor.selection); 
-173 } 
-174  
-175 // Begin shutdown if the flag was raised. 
-176 if process_should_exit() { 
-177 break; 
-178 } 
-179  } 
-180  
-181  // FIXME patch notify library to have a shutdown method 
-182  // config_reloader.join().ok(); 
-183  
-184  // Wait for the I/O thread thread to finish 
-185  let _ = io_thread.join(); 
-186  
-187  Ok(()) 
-188 } 188,1Bot[?12l[?25h[?25l7[?12l[?25h[?25l 1 // Copyright 2016 Joe Wilm, The Alacritty Project Contributors 
- 2 // 
- 3 // Licensed under the Apache License, Version 2.0 (the "License"); 
- 4 // you may not use this file except in compliance with the License. 
- 5 // You may obtain a copy of the License at 
- 6 // 
- 7 // http://www.apache.org/licenses/LICENSE-2.0 
- 8 // 
- 9 // Unless required by applicable law or agreed to in writing, software 
- 10 // distributed under the License is distributed on an "AS IS" BASIS, 
- 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- 12 // See the License for the specific language governing permissions and 
- 13 // limitations under the License. 
- 14 // 
- 15 //! Alacritty - The GPU Enhanced Terminal 
- 16 #![cfg_attr(feature = "clippy", plugin(clippy))] 
- 17 #![cfg_attr(feature = "clippy", feature(plugin))] 
- 18  
- 19 #[macro_use] 
- 20 extern crate alacritty; 
- 21  
- 22 #[macro_use] 
- 23 extern crate log; 
- 24  
- 25 use std::error::Error; 
- 26 use std::sync::Arc; 
- 27  
- 28 use alacritty::cli; 
- 29 use alacritty::config::{self, Config}; 
- 30 use alacritty::display::Display; 
- 31 use alacritty::event; 
- 32 use alacritty::event_loop::{self, EventLoop}; 
- 33 use alacritty::logging; 
- 34 use alacritty::sync::FairMutex; 
- 35 use alacritty::term::{Term}; 
- 36 use alacritty::tty::{self, process_should_exit}; 
- 37 use alacritty::util::fmt::Red; 
- 38  
- 39 fn main() { 
- 40  
- 41  // Load configuration 
- 42  let config = Config::load().unwrap_or_else(|err| { 
- 43 match err { 
- 44 // Use default config when not found 1,1Top[?12l[?25h[?25l2[?12l[?25h[?25l3[?12l[?25h[?25l4[?12l[?25h[?25l5[?12l[?25h[?25l6[?12l[?25h[?25l7[?12l[?25h[?25l8[?12l[?25h[?25l9[?12l[?25h[?25l10,1[?12l[?25h[?25l1[?12l[?25h[?25l2[?12l[?25h[?25l3[?12l[?25h[?25l4[?12l[?25h[?25l5[?12l[?25h[?25l6[?12l[?25h[?25l7[?12l[?25h[?25l8,0-1[?12l[?25h[?25l9,1 [?12l[?25h[?25l20[?12l[?25h[?25l1,0-1[?12l[?25h[?25l2,1 [?12l[?25h[?25l3[?12l[?25h[?25l4,0-1[?12l[?25h[?25l5,1 [?12l[?25h[?25l6[?12l[?25h[?25l7,0-1[?12l[?25h[?25l8,1 [?12l[?25h[?25l9[?12l[?25h[?25l30[?12l[?25h[?25l1[?12l[?25h[?25l2[?12l[?25h[?25l3[?12l[?25h[?25l4[?12l[?25h[?25l5[?12l[?25h[?25l6[?12l[?25h[?25l7[?12l[?25h[?25l8,0-1[?12l[?25h[?25l9,1 [?12l[?25h[?25l40,0-1[?12l[?25h[?25l1,1 [?12l[?25h[?25l2[?12l[?25h[?25l3[?12l[?25h[?25l4[?12l[?25h[?25l
- 45 config::Error::NotFound => { 45,10%[?12l[?25h[?25l
- 46 match Config::write_defaults() { 46,11%[?12l[?25h[?25l
- 47 Ok(path) => err_println!("Config file not found; write defaults config to {:?}", path),47,12%[?12l[?25h[?25l
- 48 Err(err) => err_println!("Write defaults config failure: {}", err) 48,12%[?12l[?25h[?25l
- 49 } 49,13%[?12l[?25h[?25l
- 50  50,0-14%[?12l[?25h[?25l
- 51 Config::load().unwrap() 51,14%[?12l[?25h[?25l
- 52 }, 52,15%[?12l[?25h[?25l
- 53  53,0-16%[?12l[?25h[?25l
- 54 // If there's a problem with the config file, print an error 54,16%[?12l[?25h[?25l
- 55 // and exit. 55,17%[?12l[?25h[?25l
- 56 _ => die!("{}", err), 56,18%[?12l[?25h[?25l
- 57 } 57,19%[?12l[?25h[?25l
- 58  }); 58,19%[?12l[?25h[?25l
- 59  59,0-110%[?12l[?25h[?25l
- 60  // Load command line options 60,111%[?12l[?25h[?25l
- 61  let options = cli::Options::load(); 61,111%[?12l[?25h[?25l
- 62  62,0-112%[?12l[?25h[?25l
- 63  // Run alacritty 63,113%[?12l[?25h[?25l
- 64  if let Err(err) = run(config, options) { 64,113%[?12l[?25h[?25l
- 65 die!("Alacritty encountered an unrecoverable error:\n\n\t{}\n", Red(err)); 65,114%[?12l[?25h[?25l
- 66  } 66,115%[?12l[?25h[?25l
- 67  67,0-115%[?12l[?25h[?25l
- 68  info!("Goodbye."); 68,116%[?12l[?25h[?25l
-{ 69 } 69,117%[?12l[?25h[?25l
-{}
- 70  70,0-118%[?12l[?25h[?25l
- 71  71,0-118%[?12l[?25h[?25l
- 72 /// Run Alacritty 72,119%[?12l[?25h[?25l
- 73 /// 73,120%[?12l[?25h[?25l
- 74 /// Creates a window, the terminal state, pty, I/O event loop, input processor, 74,120%[?12l[?25h[?25l
- 75 /// config change monitor, and runs the main display loop. 75,121%[?12l[?25h[?25l
- 76 fn run(mut config: Config, options: cli::Options) -> Result<(), Box<Error>> { 76,122%[?12l[?25h[?25l
- 77  // Initialize the logger first as to capture output from other subsystems 77,122%[?12l[?25h[?25l
- 78  logging::initialize(&options)?; 78,123%[?12l[?25h[?25l
- 79  79,0-124%[?12l[?25h[?25l
- 80  info!("Welcome to Alacritty."); 80,125%[?12l[?25h[?25l
- 81  81,0-125%[?12l[?25h[?25l
- 82  // Create a display. 82,126%[?12l[?25h[?25l
- 83  // 83,127%[?12l[?25h[?25l
- 84  // The display manages a window and can draw the terminal 84,127%[?12l[?25h[?25l
- 85  let mut display = Display::new(&config, &options)?; 85,128%[?12l[?25h[?25l
- 86  86,0-129%[?12l[?25h[?25l
- 87  info!( 87,129%[?12l[?25h[?25l
- 88 "PTY Dimensions: {:?} x {:?}", 88,130%[?12l[?25h[?25l
- 89 display.size().lines(), 89,131%[?12l[?25h[?25l
- 90 display.size().cols() 90,131%[?12l[?25h[?25l
- 91  ); 91,132%[?12l[?25h[?25l
- 92  92,0-133%[?12l[?25h[?25l
- 93  // Create the terminal 93,134%[?12l[?25h[?25l
- 94  // 94,134%[?12l[?25h[?25l
- 95  // This object contains all of the state about what's being displayed. It's 95,135%[?12l[?25h[?25l
- 96  // wrapped in a clonable mutex since both the I/O loop and display need to 96,136%[?12l[?25h[?25l
- 97  // access it. 97,136%[?12l[?25h[?25l
- 98  let terminal = Term::new(&config, display.size().to_owned()); 98,137%[?12l[?25h[?25l
- 99  let terminal = Arc::new(FairMutex::new(terminal)); 99,138%[?12l[?25h[?25l
-100  100,0-138%[?12l[?25h[?25l
-101  // Create the pty 101,139%[?12l[?25h[?25l
-102  // 102,140%[?12l[?25h[?25l
-103  // The pty forks a process to run the shell on the slave side of the 103,140%[?12l[?25h[?25l
-104  // pseudoterminal. A file descriptor for the master side is retained for 104,141%[?12l[?25h[?25l
-105  // reading/writing to the shell. 105,142%[?12l[?25h[?25l
-106  let mut pty = tty::new(&config, &options, display.size()); 106,143%[?12l[?25h[?25l
-107  107,0-143%[?12l[?25h[?25l
-108  // Create the pseudoterminal I/O loop 108,144%[?12l[?25h[?25l
-109  // 109,145%[?12l[?25h[?25l
-110  // pty I/O is ran on another thread as to not occupy cycles used by the 110,145%[?12l[?25h[?25l
-111  // renderer and input processing. Note that access to the terminal state is 111,146%[?12l[?25h[?25l
-112  // synchronized since the I/O loop updates the state, and the display 112,147%[?12l[?25h[?25l
-113  // consumes it periodically. 113,147%[?12l[?25h[?25l
-114  let event_loop = EventLoop::new( 114,148%[?12l[?25h[?25l
-115 terminal.clone(), 115,149%[?12l[?25h[?25l
-116 display.notifier(), 116,150%[?12l[?25h[?25l
-117 pty.reader(), 117,150%[?12l[?25h[?25l
-118 options.ref_test, 118,151%[?12l[?25h[?25l
-119  ); 119,152%[?12l[?25h[?25l
-120  120,0-152%[?12l[?25h[?25l
-121  // The event loop channel allows write requests from the event processor 121,153%[?12l[?25h[?25l
-122  // to be sent to the loop and ultimately written to the pty. 122,154%[?12l[?25h[?25l
-123  let loop_tx = event_loop.channel(); 123,154%[?12l[?25h[?25l
-124  124,0-155%[?12l[?25h[?25l
-125  // Event processor 125,156%[?12l[?25h[?25l
-126  // 126,156%[?12l[?25h[?25l
-127  // Need the Rc<RefCell<_>> here since a ref is shared in the resize callback 127,157%[?12l[?25h[?25l
-128  let mut processor = event::Processor::new( 128,158%[?12l[?25h[?25l
-129 event_loop::Notifier(loop_tx), 129,159%[?12l[?25h[?25l
-130 display.resize_channel(), 130,159%[?12l[?25h[?25l
-131 &options, 131,160%[?12l[?25h[?25l
-132 [3