diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2020-05-03 06:52:57 +0300 |
---|---|---|
committer | Kirill Chibisov <contact@kchibisov.com> | 2020-05-04 03:07:23 +0300 |
commit | d61228056171f89b866c61871f837a50c3cd48ea (patch) | |
tree | 69ef78283c53ced053856c1ad40db5f535df9d03 /alacritty_terminal/src/tty/windows | |
parent | fa94fc3388829cd919d2b4c14d8f0ef842a7bcc2 (diff) | |
download | alacritty-d61228056171f89b866c61871f837a50c3cd48ea.tar.gz alacritty-d61228056171f89b866c61871f837a50c3cd48ea.zip |
Add period to comments to follow styleperiod
Diffstat (limited to 'alacritty_terminal/src/tty/windows')
-rw-r--r-- | alacritty_terminal/src/tty/windows/child.rs | 4 | ||||
-rw-r--r-- | alacritty_terminal/src/tty/windows/conpty.rs | 18 | ||||
-rw-r--r-- | alacritty_terminal/src/tty/windows/mod.rs | 4 | ||||
-rw-r--r-- | alacritty_terminal/src/tty/windows/winpty.rs | 10 |
4 files changed, 18 insertions, 18 deletions
diff --git a/alacritty_terminal/src/tty/windows/child.rs b/alacritty_terminal/src/tty/windows/child.rs index 69bff75c..c841c29a 100644 --- a/alacritty_terminal/src/tty/windows/child.rs +++ b/alacritty_terminal/src/tty/windows/child.rs @@ -106,10 +106,10 @@ mod tests { child.kill().unwrap(); - // Poll for the event or fail with timeout if nothing has been sent + // Poll for the event or fail with timeout if nothing has been sent. poll.poll(&mut events, Some(WAIT_TIMEOUT)).unwrap(); assert_eq!(events.iter().next().unwrap().token(), child_events_token); - // Verify that at least one `ChildEvent::Exited` was received + // Verify that at least one `ChildEvent::Exited` was received. assert_eq!(child_exit_watcher.event_rx().try_recv(), Ok(ChildEvent::Exited)); } } diff --git a/alacritty_terminal/src/tty/windows/conpty.rs b/alacritty_terminal/src/tty/windows/conpty.rs index 99d52b05..c8a41f63 100644 --- a/alacritty_terminal/src/tty/windows/conpty.rs +++ b/alacritty_terminal/src/tty/windows/conpty.rs @@ -42,7 +42,7 @@ use crate::tty::windows::{cmdline, win32_string, Pty}; // done until a safety net is in place for versions of Windows // that do not support the ConPTY api, as such versions will // pass unit testing - but fail to actually function. -/// Dynamically-loaded Pseudoconsole API from kernel32.dll +/// Dynamically-loaded Pseudoconsole API from kernel32.dll. /// /// The field names are deliberately PascalCase as this matches /// the defined symbols in kernel32 and also is the convention @@ -58,7 +58,7 @@ struct ConptyApi { impl ConptyApi { /// Load the API or None if it cannot be found. pub fn new() -> Option<Self> { - // Unsafe because windows API calls + // Unsafe because windows API calls. unsafe { let hmodule = GetModuleHandleA("kernel32\0".as_ptr() as _); assert!(!hmodule.is_null()); @@ -80,7 +80,7 @@ impl ConptyApi { } } -/// RAII Pseudoconsole +/// RAII Pseudoconsole. pub struct Conpty { pub handle: HPCON, api: ConptyApi, @@ -91,7 +91,7 @@ impl Drop for Conpty { // XXX: This will block until the conout pipe is drained. Will cause a deadlock if the // conout pipe has already been dropped by this point. // - // See PR #3084 and https://docs.microsoft.com/en-us/windows/console/closepseudoconsole + // See PR #3084 and https://docs.microsoft.com/en-us/windows/console/closepseudoconsole. unsafe { (self.api.ClosePseudoConsole)(self.handle) } } } @@ -118,7 +118,7 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, _window_id: Option<usize>) -> let coord = coord_from_sizeinfo(size).expect("Overflow when creating initial size on pseudoconsole"); - // Create the Pseudo Console, using the pipes + // Create the Pseudo Console, using the pipes. let result = unsafe { (api.CreatePseudoConsole)( coord, @@ -133,7 +133,7 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, _window_id: Option<usize>) -> let mut success; - // Prepare child process startup info + // Prepare child process startup info. let mut size: SIZE_T = 0; @@ -185,12 +185,12 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, _window_id: Option<usize>) -> } } - // Set thread attribute list's Pseudo Console to the specified ConPTY + // Set thread attribute list's Pseudo Console to the specified ConPTY. unsafe { success = UpdateProcThreadAttribute( startup_info_ex.lpAttributeList, 0, - 22 | 0x0002_0000, // PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE + 22 | 0x0002_0000, // PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE. pty_handle, mem::size_of::<HPCON>(), ptr::null_mut(), @@ -242,7 +242,7 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, _window_id: Option<usize>) -> }) } -// Panic with the last os error as message +// Panic with the last os error as message. fn panic_shell_spawn() { panic!("Unable to spawn shell: {}", Error::last_os_error()); } diff --git a/alacritty_terminal/src/tty/windows/mod.rs b/alacritty_terminal/src/tty/windows/mod.rs index 03e2a3cd..8e5b4668 100644 --- a/alacritty_terminal/src/tty/windows/mod.rs +++ b/alacritty_terminal/src/tty/windows/mod.rs @@ -51,9 +51,9 @@ pub struct Pty { // `conout` before `backend` will cause a deadlock. backend: PtyBackend, // TODO: It's on the roadmap for the Conpty API to support Overlapped I/O. - // See https://github.com/Microsoft/console/issues/262 + // See https://github.com/Microsoft/console/issues/262. // When support for that lands then it should be possible to use - // NamedPipe for the conout and conin handles + // NamedPipe for the conout and conin handles. conout: EventedReadablePipe, conin: EventedWritablePipe, read_token: mio::Token, diff --git a/alacritty_terminal/src/tty/windows/winpty.rs b/alacritty_terminal/src/tty/windows/winpty.rs index 5fa6feea..d466955d 100644 --- a/alacritty_terminal/src/tty/windows/winpty.rs +++ b/alacritty_terminal/src/tty/windows/winpty.rs @@ -31,25 +31,25 @@ use crate::tty::windows::{cmdline, Pty}; pub use winpty::Winpty as Agent; pub fn new<C>(config: &Config<C>, size: &SizeInfo, _window_id: Option<usize>) -> Pty { - // Create config + // Create config. let mut wconfig = WinptyConfig::new(ConfigFlags::empty()).unwrap(); wconfig.set_initial_size(size.cols().0 as i32, size.lines().0 as i32); wconfig.set_mouse_mode(&MouseMode::Auto); - // Start agent + // Start agent. let mut agent = Winpty::open(&wconfig).unwrap(); let (conin, conout) = (agent.conin_name(), agent.conout_name()); let cmdline = cmdline(&config); - // Spawn process + // Spawn process. let spawnconfig = SpawnConfig::new( SpawnFlags::AUTO_SHUTDOWN | SpawnFlags::EXIT_AFTER_SHUTDOWN, - None, // appname + None, // appname. Some(&cmdline), config.working_directory.as_ref().map(|p| p.as_path()), - None, // Env + None, // Env. ) .unwrap(); |