diff --git a/tests/batch_ftdetect_res.vim b/tests/batch_ftdetect_res.vim index a16439f..3134233 100644 --- a/tests/batch_ftdetect_res.vim +++ b/tests/batch_ftdetect_res.vim @@ -3,7 +3,4 @@ set nomore bufdo redir >> $OUTPUT | echo @% | set ft? | redir END -" Prevent stalling on 'Press ENTER or type command to continue' -call feedkeys("\") - qa diff --git a/tests/src/common.rs b/tests/src/common.rs index 2287902..5c2c6bd 100644 --- a/tests/src/common.rs +++ b/tests/src/common.rs @@ -2,7 +2,7 @@ use std::{ env, ffi::OsString, fs::canonicalize, - io::{self, ErrorKind}, + io::{self, prelude::*, ErrorKind}, os::unix::fs as ufs, path::{Path, PathBuf}, process::{Command, Stdio}, @@ -76,12 +76,16 @@ pub fn run_vim( .env("HOME", home) .env("XDG_CONFIG_HOME", home) .env("XDG_DATA_HOME", home) - .stdin(Stdio::null()) + .stdin(Stdio::piped()) .stdout(Stdio::null()) .stderr(Stdio::piped()) .spawn() .unwrap(); + let mut vim_stdin = vim.stdin.take().unwrap(); + // Prevent stalling on "Press ENTER or type command to continue" + vim_stdin.write_all(b"\r")?; + let status = loop { let poll_interval = Duration::from_millis(200); match vim.wait_timeout(poll_interval) {