mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 08:03:13 +02:00
* Added loginshell config file #4620 * added sample login.nu * added environment variable loginshell-path
This commit is contained in:
@ -19,13 +19,14 @@ fn variables_completions() {
|
||||
// Test completions for $nu
|
||||
let suggestions = completer.complete("$nu.", 4);
|
||||
|
||||
assert_eq!(8, suggestions.len());
|
||||
assert_eq!(9, suggestions.len());
|
||||
|
||||
let expected: Vec<String> = vec![
|
||||
"config-path".into(),
|
||||
"env-path".into(),
|
||||
"history-path".into(),
|
||||
"home-path".into(),
|
||||
"loginshell-path".into(),
|
||||
"os-info".into(),
|
||||
"pid".into(),
|
||||
"scope".into(),
|
||||
|
@ -1196,6 +1196,7 @@ pub fn eval_variable(
|
||||
if let Some(mut config_path) = nu_path::config_dir() {
|
||||
config_path.push("nushell");
|
||||
let mut env_config_path = config_path.clone();
|
||||
let mut loginshell_path = config_path.clone();
|
||||
|
||||
let mut history_path = config_path.clone();
|
||||
|
||||
@ -1222,6 +1223,14 @@ pub fn eval_variable(
|
||||
val: env_config_path.to_string_lossy().to_string(),
|
||||
span,
|
||||
});
|
||||
|
||||
loginshell_path.push("login.nu");
|
||||
|
||||
output_cols.push("loginshell-path".into());
|
||||
output_vals.push(Value::String {
|
||||
val: loginshell_path.to_string_lossy().to_string(),
|
||||
span,
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "plugin")]
|
||||
|
Reference in New Issue
Block a user