Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 136 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ toml_edit = "0.21.*"
shellexpand = "2.1.*"
log = "0.4.*"
env_logger = "0.10.*"
sysinfo = "0.22.*"
sysinfo = "0.33.*"

[package.metadata.deb]
maintainer = "beeender <chenmulong@gmail.com>"
Expand Down
6 changes: 2 additions & 4 deletions src/backend/alacritty.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use super::Functions;
use crate::config::Config;
use crate::error::GlrnvimError;
use std::ffi::OsStr;
use std::fs;
use std::path::Path;
use std::path::PathBuf;
use std::{thread, time};
use sysinfo::{Pid, ProcessExt, Signal, System, SystemExt};
use sysinfo::{Pid, Signal, System};
use tempfile::NamedTempFile;
extern crate log;
use toml_edit::{value, Document, Item, Table, Value};
Expand Down Expand Up @@ -149,7 +148,6 @@ impl Functions for Alacritty {
fn post_start(&mut self, config: &Config, term_pid: Pid) {
let proc_name = match Path::new(&config.nvim_exe_path)
.file_name()
.and_then(OsStr::to_str)
{
None => {
log::warn!(
Expand All @@ -166,7 +164,7 @@ impl Functions for Alacritty {
loop {
count += 1;
let s = System::new_all();
for process in s.process_by_name(proc_name) {
for process in s.processes_by_name(proc_name) {
match process.parent() {
None => {}
Some(ppid) => {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
log::debug!("Start command: {:?}", command);
let mut child = command.spawn()?;

backend_functions.post_start(&config, child.id() as Pid);
backend_functions.post_start(&config, Pid::from_u32(child.id()));

if config.fork {
std::process::exit(0);
Expand Down