1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-27 15:37:29 +03:00
This commit is contained in:
Wez Furlong 2019-03-02 09:33:45 -08:00
parent bc15fc4665
commit 150225dd22
2 changed files with 14 additions and 7 deletions

View File

@ -151,7 +151,7 @@ impl CoreTextFontImpl {
let m_metrics = metrics('M', &ct_font);
let zero_metrics = metrics('0', &ct_font);
let metrics = w_metrics.unwrap_or_else(|| {
m_metrics.unwrap_or_else(|| zero_metrics.unwrap_or_else(|| Default::default()))
m_metrics.unwrap_or_else(|| zero_metrics.unwrap_or_else(Default::default))
});
Self {
ct_font,

View File

@ -205,12 +205,19 @@ impl SlavePty {
return Err(io::Error::last_os_error());
}
// Set the pty as the controlling terminal.
// Failure to do this means that delivery of
// SIGWINCH won't happen when we resize the
// terminal, among other undesirable effects.
if libc::ioctl(0, libc::TIOCSCTTY as _, 0) == -1 {
return Err(io::Error::last_os_error());
// Clippy wants us to explicitly cast TIOCSCTTY using
// type::from(), but the size and potentially signedness
// are system dependent, which is why we're using `as _`.
// Suppress this lint for this section of code.
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_lossless))]
{
// Set the pty as the controlling terminal.
// Failure to do this means that delivery of
// SIGWINCH won't happen when we resize the
// terminal, among other undesirable effects.
if libc::ioctl(0, libc::TIOCSCTTY as _, 0) == -1 {
return Err(io::Error::last_os_error());
}
}
Ok(())
}