T18 review fixes: a missing folder stops the start, combining marks paint on their cell, the terminal is a Tab stop and keeps its wheel, clear drops find matches; the gallery starts a fresh shell per pick and picks the shell tab before typing
This commit is contained in:
1 parent
7da1368cd9
commit
f6ad8d1e50
9 files changed
+134
-26
No files matched your search
@@ -49,6 +49,13 @@ pub(crate) fn detached(size: TermSize) -> Session {
|
||||
|
||||
/// Starts `launch` on a pseudo-terminal of `size` cells, each `cell` pixels.
|
||||
pub(crate) fn spawn(launch: &Launch, size: TermSize, cell: (u16, u16)) -> anyhow::Result<Session> {
|
||||
if let Some(cwd) = &launch.cwd {
|
||||
anyhow::ensure!(
|
||||
cwd.is_dir(),
|
||||
"a terminal cannot start in {}: no such folder",
|
||||
cwd.display()
|
||||
);
|
||||
}
|
||||
let (sender, events) = unbounded();
|
||||
let listener = Listener(sender);
|
||||
let term = Arc::new(FairMutex::new(Term::new(
|
||||
@@ -103,6 +110,19 @@ mod tests {
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn a_missing_folder_stops_the_start() {
|
||||
let launch = Launch {
|
||||
program: Some(("/bin/sh".into(), vec!["-c".into(), "true".into()])),
|
||||
cwd: Some("/nonexistent/ely".into()),
|
||||
..Launch::default()
|
||||
};
|
||||
let error = spawn(&launch, TermSize::new(20, 4), (8, 16))
|
||||
.err()
|
||||
.expect("a missing folder is an error");
|
||||
assert!(error.to_string().contains("/nonexistent/ely"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_program_prints_into_the_grid_through_a_pseudo_terminal() {
|
||||
let launch = Launch {
|
||||
|
||||
Reference in new issue
Block a user