skipped 33 lines 34 34 use alacritty_terminal::term::search::{Match, RegexSearch}; 35 35 use alacritty_terminal::term::{ClipboardType, SizeInfo, Term, TermMode}; 36 36 37 - use crate::cli::{Options as CliOptions, TerminalOptions as TerminalCliOptions }; 37 + use crate::cli::{Options as CliOptions, TerminalOptions}; 38 38 use crate::clipboard::Clipboard; 39 39 use crate::config::ui_config::{HintAction, HintInternalAction}; 40 40 use crate::config::{self, UiConfig}; skipped 47 lines 88 88 ConfigReload(PathBuf), 89 89 Message(Message), 90 90 Scroll(Scroll), 91 - CreateWindow(Option<TerminalCliOptions>), 91 + CreateWindow(TerminalOptions), 92 92 BlinkCursor, 93 93 SearchNext, 94 94 } skipped 284 lines 379 379 380 380 #[cfg(not(windows))] 381 381 fn create_new_window(&mut self) { 382 - let cwd = foreground_process_path(self.master_fd, self.shell_pid); 383 - let options = if let Ok(working_directory) = cwd { 384 - let mut options = TerminalCliOptions::new(); 382 + let mut options = TerminalOptions::default(); 383 + if let Ok(working_directory) = foreground_process_path(self.master_fd, self.shell_pid) { 385 384 options.working_directory = Some(working_directory); 386 - Some(options) 387 - } else { 388 - None 389 - }; 385 + } 390 386 391 387 let _ = self.event_proxy.send_event(Event::new(EventType::CreateWindow(options), None)); 392 388 } 393 389 394 390 #[cfg(windows)] 395 391 fn create_new_window(&mut self) { 396 - let _ = self.event_proxy.send_event(Event::new(EventType::CreateWindow(None), None)); 392 + let _ = self 393 + .event_proxy 394 + .send_event(Event::new(EventType::CreateWindow(TerminalOptions::default()), None)); 397 395 } 398 396 399 397 fn spawn_daemon<I, S>(&self, program: &str, args: I) skipped 353 lines 753 751 } 754 752 } else if self.terminal().mode().contains(TermMode::BRACKETED_PASTE) { 755 753 self.write_to_pty(&b"\x1b[200~"[..]); 756 - self.write_to_pty(text.replace(" \x1b" , "").into_bytes()); 754 + self.write_to_pty(text.replace(' \x1b' , "").into_bytes()); 757 755 self.write_to_pty(&b"\x1b[201~"[..]); 758 756 } else { 759 757 // In non-bracketed (ie: normal) mode, terminal applications cannot distinguish skipped 2 lines 762 760 // pasting... since that's neither practical nor sensible (and probably an impossible 763 761 // task to solve in a general way), we'll just replace line breaks (windows and unix 764 762 // style) with a single carriage return (\r, which is what the Enter key produces). 765 - self.write_to_pty(text.replace("\r\n", "\r").replace(" \n" , "\r").into_bytes()); 763 + self.write_to_pty(text.replace("\r\n", "\r").replace(' \n' , "\r").into_bytes()); 766 764 } 767 765 } 768 766 skipped 438 lines 1207 1205 pub fn create_window( 1208 1206 &mut self, 1209 1207 event_loop: &EventLoopWindowTarget<Event>, 1210 - options: Option<TerminalCliOptions>, 1211 1208 proxy: EventLoopProxy<Event>, 1209 + options: TerminalOptions, 1212 1210 ) -> Result<(), Box<dyn Error>> { 1211 + let mut pty_config = self.config.terminal_config.pty_config.clone(); 1212 + options.override_pty_config(&mut pty_config); 1213 + 1213 1214 let window_context = WindowContext::new( 1214 1215 &self.config, 1215 - options, 1216 + &pty_config, 1216 1217 event_loop, 1217 1218 proxy, 1218 1219 #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] skipped 101 lines 1320 1321 GlutinEvent::UserEvent(Event { 1321 1322 payload: EventType::CreateWindow(options), .. 1322 1323 }) => { 1323 - if let Err(err) = self.create_window(event_loop, options , proxy.clone()) { 1324 + if let Err(err) = self.create_window(event_loop, proxy.clone(), options ) { 1324 1325 error!("Could not open window: {:?}", err); 1325 1326 } 1326 1327 }, skipped 80 lines