diff --git a/crates/nu-cli/src/commands/shells.rs b/crates/nu-cli/src/commands/shells.rs index 93d05b5193..3521dbfb1d 100644 --- a/crates/nu-cli/src/commands/shells.rs +++ b/crates/nu-cli/src/commands/shells.rs @@ -36,9 +36,9 @@ fn shells(args: CommandArgs, _registry: &CommandRegistry) -> Result Ok(scope.it.value.clone().into_value(tag)), hir::Variable::Other(_, span) => match span.slice(source) { - x if x == "nu" => crate::evaluate::variables::nu(tag), + x if x == "$nu" => crate::evaluate::variables::nu(tag), x => Ok(scope .vars .get(x) diff --git a/crates/nu-parser/src/parse.rs b/crates/nu-parser/src/parse.rs index 15fd031644..e5344829a2 100644 --- a/crates/nu-parser/src/parse.rs +++ b/crates/nu-parser/src/parse.rs @@ -192,6 +192,7 @@ fn parse_full_column_path(lite_arg: &Spanned) -> (SpannedExpression, Opt if head.is_none() { if current_part.starts_with('$') { + // We have the variable head head = Some(Expression::variable(current_part, lite_arg.span)); } else if let Ok(row_number) = current_part.parse::() { output.push(