T23: the shell tests type a line only once the line editor reads raw keys: on CI's pwsh 7.6.6 the probe, typed right after the first folder report, came before PSReadLine's first read and was echoed, never run; shot warns when the app it runs under lacks Screen Recording, which left this Mac's pictures with the window's ground alone; AGENTS.md records the CI runners, the build without debuginfo and the typing rule
This commit is contained in:
5 files changed
+37
-4
No files matched your search
@@ -56,6 +56,8 @@ pub struct Pty {
|
||||
pub term: Arc<FairMutex<Term<Listener>>>,
|
||||
pub pid: u32,
|
||||
notifier: Notifier,
|
||||
#[cfg(all(test, unix))]
|
||||
master: std::fs::File,
|
||||
}
|
||||
|
||||
/// What a pty reports, in order.
|
||||
@@ -109,6 +111,10 @@ pub fn spawn(
|
||||
)
|
||||
})?;
|
||||
let pid = child_id(&raw)?;
|
||||
#[cfg(all(test, unix))]
|
||||
let master = raw
|
||||
.master()
|
||||
.map_err(|error| anyhow::anyhow!("pty {pid}: no copy of the master: {error}"))?;
|
||||
log::info!(
|
||||
"pty {pid}: started {:?} in {}",
|
||||
launch.program,
|
||||
@@ -135,6 +141,8 @@ pub fn spawn(
|
||||
term,
|
||||
pid,
|
||||
notifier,
|
||||
#[cfg(all(test, unix))]
|
||||
master,
|
||||
},
|
||||
events,
|
||||
))
|
||||
@@ -176,6 +184,16 @@ impl Pty {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(test, unix))]
|
||||
impl Pty {
|
||||
/// Whether the program reads keys one by one, as a line editor does.
|
||||
pub(crate) fn reads_keys(&self) -> bool {
|
||||
use rustix_openpty::rustix::termios::{LocalModes, tcgetattr};
|
||||
let modes = tcgetattr(&self.master).expect("the pty's modes");
|
||||
!modes.local_modes.contains(LocalModes::ICANON)
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Pty {
|
||||
fn drop(&mut self) {
|
||||
if self.notifier.0.send(Msg::Shutdown).is_err() {
|
||||
|
||||
Reference in new issue
Block a user