Set "--no-config-file"

This commit is contained in:
YizhePKU 2024-06-02 23:35:06 +00:00
parent 68be6cd0e6
commit 4bb195e36f
2 changed files with 7 additions and 7 deletions

View File

@ -73,10 +73,13 @@ pub fn default_terminal() -> (Term<EventProxy>, mpsc::Receiver<Event>) {
/// Creates a PTY and connect the slave end to a Nushell process. If `pwd` is
/// None, the Nushell process will inherit PWD from the current process.
pub fn pty_with_nushell(args: Vec<String>, pwd: Option<PathBuf>) -> Pty {
pub fn pty_with_nushell(args: Vec<&str>, pwd: Option<PathBuf>) -> Pty {
let executable = crate::fs::executable_path().to_string_lossy().to_string();
let options = Options {
shell: Some(Shell::new(executable, args)),
shell: Some(Shell::new(
executable,
args.iter().map(|s| s.to_string()).collect(),
)),
working_directory: pwd,
hold: false,
env: HashMap::new(),

View File

@ -12,10 +12,7 @@ fn auto_cd_works() {
std::fs::create_dir(cwd.path().join("foo")).unwrap();
// Create the PTY and the terminal.
let mut pty = pty_with_nushell(
vec!["--no-config-file".to_string()],
Some(cwd.path().to_path_buf()),
);
let mut pty = pty_with_nushell(vec!["--no-config-file"], Some(cwd.path().to_path_buf()));
let (mut term, mut events) = default_terminal();
// Wait for Nushell to initialize.
@ -55,7 +52,7 @@ fn command_hints_are_pwd_aware() {
// Create the PTY and the terminal.
let mut pty = pty_with_nushell(
vec!["--config".to_string(), nu_config_string],
vec!["--no-config-file", "--config", &nu_config_string],
Some(cwd.path().to_path_buf()),
);
let (mut term, mut events) = default_terminal();