mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-19 02:17:35 +03:00
parent
0037f0b2fd
commit
77974a4367
@ -11,6 +11,9 @@ use fsevent::StreamFlags;
|
|||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
use notify::{Config, EventKind, Watcher};
|
use notify::{Config, EventKind, Watcher};
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
use std::os::unix::fs::MetadataExt;
|
||||||
|
|
||||||
use futures::{future::BoxFuture, Stream, StreamExt};
|
use futures::{future::BoxFuture, Stream, StreamExt};
|
||||||
use git2::Repository as LibGitRepository;
|
use git2::Repository as LibGitRepository;
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
@ -21,7 +24,6 @@ use std::io::Write;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::{
|
use std::{
|
||||||
io,
|
io,
|
||||||
os::unix::fs::MetadataExt,
|
|
||||||
path::{Component, Path, PathBuf},
|
path::{Component, Path, PathBuf},
|
||||||
pin::Pin,
|
pin::Pin,
|
||||||
time::{Duration, SystemTime},
|
time::{Duration, SystemTime},
|
||||||
@ -239,8 +241,16 @@ impl Fs for RealFs {
|
|||||||
} else {
|
} else {
|
||||||
symlink_metadata
|
symlink_metadata
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
let inode = metadata.ino();
|
||||||
|
|
||||||
|
// todo!(windows)
|
||||||
|
#[cfg(windows)]
|
||||||
|
let inode = 0;
|
||||||
|
|
||||||
Ok(Some(Metadata {
|
Ok(Some(Metadata {
|
||||||
inode: metadata.ino(),
|
inode,
|
||||||
mtime: metadata.modified().unwrap(),
|
mtime: metadata.modified().unwrap(),
|
||||||
is_symlink,
|
is_symlink,
|
||||||
is_dir: metadata.file_type().is_dir(),
|
is_dir: metadata.file_type().is_dir(),
|
||||||
|
@ -45,13 +45,15 @@ use std::{
|
|||||||
cmp::{self, min},
|
cmp::{self, min},
|
||||||
fmt::Display,
|
fmt::Display,
|
||||||
ops::{Deref, Index, RangeInclusive},
|
ops::{Deref, Index, RangeInclusive},
|
||||||
os::unix::prelude::AsRawFd,
|
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
use std::os::unix::prelude::AsRawFd;
|
||||||
|
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions, black, px, AnyWindowHandle, AppContext, Bounds, ClipboardItem, EventEmitter, Hsla,
|
actions, black, px, AnyWindowHandle, AppContext, Bounds, ClipboardItem, EventEmitter, Hsla,
|
||||||
Keystroke, ModelContext, Modifiers, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent,
|
Keystroke, ModelContext, Modifiers, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent,
|
||||||
@ -376,8 +378,12 @@ impl TerminalBuilder {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let fd = pty.file().as_raw_fd();
|
#[cfg(unix)]
|
||||||
let shell_pid = pty.child().id();
|
let (fd, shell_pid) = (pty.file().as_raw_fd(), pty.child().id());
|
||||||
|
|
||||||
|
// todo!(windows)
|
||||||
|
#[cfg(windows)]
|
||||||
|
let (fd, shell_pid) = (-1, 0);
|
||||||
|
|
||||||
//And connect them together
|
//And connect them together
|
||||||
let event_loop = EventLoop::new(
|
let event_loop = EventLoop::new(
|
||||||
@ -641,7 +647,11 @@ impl Terminal {
|
|||||||
|
|
||||||
/// Updates the cached process info, returns whether the Zed-relevant info has changed
|
/// Updates the cached process info, returns whether the Zed-relevant info has changed
|
||||||
fn update_process_info(&mut self) -> bool {
|
fn update_process_info(&mut self) -> bool {
|
||||||
|
#[cfg(unix)]
|
||||||
let mut pid = unsafe { libc::tcgetpgrp(self.shell_fd as i32) };
|
let mut pid = unsafe { libc::tcgetpgrp(self.shell_fd as i32) };
|
||||||
|
// todo!(windows)
|
||||||
|
#[cfg(windows)]
|
||||||
|
let mut pid = -1;
|
||||||
if pid < 0 {
|
if pid < 0 {
|
||||||
pid = self.shell_pid as i32;
|
pid = self.shell_pid as i32;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user