Bump minimum supported Rust version to 1.43.0

This commit is contained in:
Kirill Chibisov 2020-07-28 13:00:55 +03:00 committed by GitHub
parent b7faa9f437
commit 6c4e45f3a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 79 additions and 107 deletions

View File

@ -12,10 +12,10 @@ sources:
tasks:
- rustup: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable --profile minimal
- 1-41-0: |
$HOME/.cargo/bin/rustup toolchain install --profile minimal 1.41.0
- 1-43-1: |
$HOME/.cargo/bin/rustup toolchain install --profile minimal 1.43.1
cd alacritty
$HOME/.cargo/bin/cargo +1.41.0 test
$HOME/.cargo/bin/cargo +1.43.1 test
- stable: |
cd alacritty
$HOME/.cargo/bin/cargo +stable test

View File

@ -13,7 +13,7 @@ os:
- osx
rust:
- 1.41.0
- 1.43.1
- stable
matrix:
@ -26,18 +26,18 @@ matrix:
- name: "Clippy Linux"
os: linux
env: CLIPPY=true
rust: 1.41.0
rust: 1.43.1
- name: "Clippy OSX"
os: osx
env: CLIPPY=true
rust: 1.41.0
rust: 1.43.1
- name: "Clippy Windows"
os: windows
env: CLIPPY=true
rust: 1.41.0-x86_64-pc-windows-msvc
- name: "Windows 1.41.0"
rust: 1.43.1-x86_64-pc-windows-msvc
- name: "Windows 1.43.1"
os: windows
rust: 1.41.0-x86_64-pc-windows-msvc
rust: 1.43.1-x86_64-pc-windows-msvc
- name: "Windows Stable"
os: windows
rust: stable-x86_64-pc-windows-msvc

View File

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## 0.6.0-dev
### Packaging
- Minimum Rust version has been bumped to 1.43.0
### Added
- Secondary device attributes escape (`CSI > 0 c`)

View File

@ -21,9 +21,6 @@ use std::env;
use std::fs::File;
use std::path::Path;
#[cfg(windows)]
use embed_resource;
fn main() {
let hash = rustc_tools_util::get_commit_hash().unwrap_or_default();
println!("cargo:rustc-env=GIT_HASH={}", hash);

View File

@ -29,15 +29,10 @@ impl Clipboard {
#[cfg(not(any(target_os = "macos", windows)))]
pub fn new(_display: Option<*mut c_void>) -> Self {
#[cfg(feature = "wayland")]
{
if let Some(display) = _display {
let (selection, clipboard) =
unsafe { wayland_clipboard::create_clipboards_from_external(display) };
return Self {
clipboard: Box::new(clipboard),
selection: Some(Box::new(selection)),
};
}
if let Some(display) = _display {
let (selection, clipboard) =
unsafe { wayland_clipboard::create_clipboards_from_external(display) };
return Self { clipboard: Box::new(clipboard), selection: Some(Box::new(selection)) };
}
#[cfg(feature = "x11")]

View File

@ -4,8 +4,6 @@ use std::fs;
use std::io;
use std::path::PathBuf;
#[cfg(windows)]
use dirs;
use log::{error, warn};
use alacritty_terminal::config::{Config as TermConfig, LOG_TARGET_CONFIG};

View File

@ -188,11 +188,9 @@ impl Display {
// Initialize Wayland event queue, to handle Wayland callbacks.
#[cfg(not(any(target_os = "macos", windows)))]
{
if let Some(display) = event_loop.wayland_display() {
let display = unsafe { WaylandDisplay::from_external_display(display as _) };
wayland_event_queue = Some(display.create_event_queue());
}
if let Some(display) = event_loop.wayland_display() {
let display = unsafe { WaylandDisplay::from_external_display(display as _) };
wayland_event_queue = Some(display.create_event_queue());
}
// Create the window where Alacritty will be displayed.
@ -271,16 +269,14 @@ impl Display {
#[cfg(not(any(target_os = "macos", windows)))]
let is_x11 = event_loop.is_x11();
// On Wayland we can safely ignore this call, since the window isn't visible until you
// actually draw something into it and commit those changes.
#[cfg(not(any(target_os = "macos", windows)))]
{
// On Wayland we can safely ignore this call, since the window isn't visible until you
// actually draw something into it and commit those changes.
if is_x11 {
window.swap_buffers();
renderer.with_api(&config.ui_config, config.cursor, &size_info, |api| {
api.finish();
});
}
if is_x11 {
window.swap_buffers();
renderer.with_api(&config.ui_config, config.cursor, &size_info, |api| {
api.finish();
});
}
window.set_visible(true);
@ -608,15 +604,13 @@ impl Display {
self.window.swap_buffers();
#[cfg(not(any(target_os = "macos", windows)))]
{
if self.is_x11 {
// On X11 `swap_buffers` does not block for vsync. However the next OpenGl command
// will block to synchronize (this is `glClear` in Alacritty), which causes a
// permanent one frame delay.
self.renderer.with_api(&config.ui_config, config.cursor, &size_info, |api| {
api.finish();
});
}
if self.is_x11 {
// On X11 `swap_buffers` does not block for vsync. However the next OpenGl command
// will block to synchronize (this is `glClear` in Alacritty), which causes a
// permanent one frame delay.
self.renderer.with_api(&config.ui_config, config.cursor, &size_info, |api| {
api.finish();
});
}
}

View File

@ -830,14 +830,10 @@ impl<N: Notify + OnResize> Processor<N> {
self.submit_display_update(&mut terminal, old_is_searching, display_update_pending);
}
// Skip rendering on Wayland until we get frame event from compositor.
#[cfg(not(any(target_os = "macos", windows)))]
{
// Skip rendering on Wayland until we get frame event from compositor.
if event_loop.is_wayland()
&& !self.display.window.should_draw.load(Ordering::Relaxed)
{
return;
}
if event_loop.is_wayland() && !self.display.window.should_draw.load(Ordering::Relaxed) {
return;
}
if terminal.dirty {
@ -934,15 +930,13 @@ impl<N: Notify + OnResize> Processor<N> {
match event {
WindowEvent::CloseRequested => processor.ctx.terminal.exit(),
WindowEvent::Resized(size) => {
// Minimizing the window sends a Resize event with zero width and
// height. But there's no need to ever actually resize to this.
// Both WinPTY & ConPTY have issues when resizing down to zero size
// and back.
#[cfg(windows)]
{
// Minimizing the window sends a Resize event with zero width and
// height. But there's no need to ever actually resize to this.
// Both WinPTY & ConPTY have issues when resizing down to zero size
// and back.
if size.width == 0 && size.height == 0 {
return;
}
if size.width == 0 && size.height == 0 {
return;
}
processor.ctx.display_update_pending.set_dimensions(size);
@ -1091,10 +1085,8 @@ impl<N: Notify + OnResize> Processor<N> {
}
#[cfg(not(any(target_os = "macos", windows)))]
{
if processor.ctx.event_loop.is_wayland() {
processor.ctx.window.set_wayland_theme(&config.colors);
}
if processor.ctx.event_loop.is_wayland() {
processor.ctx.window.set_wayland_theme(&config.colors);
}
// Set subpixel anti-aliasing.

View File

@ -15,8 +15,6 @@ use std::fs;
use std::io::{self, Write};
use std::sync::Arc;
#[cfg(target_os = "macos")]
use dirs;
use glutin::event_loop::EventLoop as GlutinEventLoop;
use log::{error, info};
#[cfg(windows)]

View File

@ -176,22 +176,20 @@ impl Window {
let mut wayland_surface = None;
#[cfg(not(any(target_os = "macos", windows)))]
{
if event_loop.is_x11() {
// On X11, embed the window inside another if the parent ID has been set.
if let Some(parent_window_id) = window_config.embed {
x_embed_window(windowed_context.window(), parent_window_id);
}
} else {
// Apply client side decorations theme.
let theme = AlacrittyWaylandTheme::new(&config.colors);
windowed_context.window().set_wayland_theme(theme);
// Attach surface to Alacritty's internal wayland queue to handle frame callbacks.
let surface = windowed_context.window().wayland_surface().unwrap();
let proxy: Proxy<WlSurface> = unsafe { Proxy::from_c_ptr(surface as _) };
wayland_surface = Some(proxy.attach(wayland_event_queue.as_ref().unwrap().token()));
if event_loop.is_x11() {
// On X11, embed the window inside another if the parent ID has been set.
if let Some(parent_window_id) = window_config.embed {
x_embed_window(windowed_context.window(), parent_window_id);
}
} else {
// Apply client side decorations theme.
let theme = AlacrittyWaylandTheme::new(&config.colors);
windowed_context.window().set_wayland_theme(theme);
// Attach surface to Alacritty's internal wayland queue to handle frame callbacks.
let surface = windowed_context.window().wayland_surface().unwrap();
let proxy: Proxy<WlSurface> = unsafe { Proxy::from_c_ptr(surface as _) };
wayland_surface = Some(proxy.attach(wayland_event_queue.as_ref().unwrap().token()));
}
Ok(Self {

View File

@ -355,26 +355,22 @@ where
|| token == self.pty.write_token() =>
{
#[cfg(unix)]
{
if UnixReady::from(event.readiness()).is_hup() {
// Don't try to do I/O on a dead PTY.
continue;
}
if UnixReady::from(event.readiness()).is_hup() {
// Don't try to do I/O on a dead PTY.
continue;
}
if event.readiness().is_readable() {
if let Err(err) = self.pty_read(&mut state, &mut buf, pipe.as_mut())
{
// On Linux, a `read` on the master side of a PTY can fail
// with `EIO` if the client side hangs up. In that case,
// just loop back round for the inevitable `Exited` event.
// This sucks, but checking the process is either racy or
// blocking.
#[cfg(target_os = "linux")]
{
// On Linux, a `read` on the master side of a PTY can fail
// with `EIO` if the client side hangs up. In that case,
// just loop back round for the inevitable `Exited` event.
// This sucks, but checking the process is either racy or
// blocking.
if err.kind() == ErrorKind::Other {
continue;
}
if err.kind() == ErrorKind::Other {
continue;
}
error!("Error reading from PTY in event loop: {}", err);

View File

@ -425,9 +425,11 @@ impl<'a, C> Iterator for RenderableCellsIter<'a, C> {
// Apply cursor color, or invert the cursor if it has a fixed background close
// to the cell's background.
match self.cursor.cursor_color {
CellRgb::Rgb(color) if color.contrast(cell.bg) < MIN_CURSOR_CONTRAST => (),
_ => cell.fg = self.cursor.cursor_color.color(cell.fg, cell.bg),
if !matches!(
self.cursor.cursor_color,
CellRgb::Rgb(color) if color.contrast(cell.bg) < MIN_CURSOR_CONTRAST
) {
cell.fg = self.cursor.cursor_color.color(cell.fg, cell.bg);
}
return Some(cell);

View File

@ -1,6 +1,7 @@
//! TTY related functionality.
use std::borrow::Cow;
#[cfg(not(target_os = "macos"))]
use std::env;
use std::ffi::CStr;
use std::fs::File;
@ -148,12 +149,10 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, window_id: Option<usize>) ->
let (master, slave) = make_pty(size.to_winsize());
#[cfg(any(target_os = "linux", target_os = "macos"))]
{
if let Ok(mut termios) = termios::tcgetattr(master) {
// Set character encoding to UTF-8.
termios.input_flags.set(InputFlags::IUTF8, true);
let _ = termios::tcsetattr(master, SetArg::TCSANOW, &termios);
}
if let Ok(mut termios) = termios::tcgetattr(master) {
// Set character encoding to UTF-8.
termios.input_flags.set(InputFlags::IUTF8, true);
let _ = termios::tcsetattr(master, SetArg::TCSANOW, &termios);
}
let mut buf = [0; 1024];

View File

@ -5,7 +5,6 @@ use std::os::windows::io::IntoRawHandle;
use std::ptr;
use mio_anonymous_pipes::{EventedAnonRead, EventedAnonWrite};
use miow;
use winapi::shared::basetsd::{PSIZE_T, SIZE_T};
use winapi::shared::minwindef::{BYTE, DWORD};
use winapi::shared::ntdef::{HANDLE, HRESULT, LPWSTR};

View File

@ -34,7 +34,7 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, _window_id: Option<usize>) ->
SpawnFlags::AUTO_SHUTDOWN | SpawnFlags::EXIT_AFTER_SHUTDOWN,
None, // appname.
Some(&cmdline),
config.working_directory.as_ref().map(|p| p.as_path()),
config.working_directory.as_deref(),
None, // Env.
)
.unwrap();