mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 16:33:37 +01:00
fix nu variable. tweak shells (#1558)
This commit is contained in:
parent
d0618b0b32
commit
183c8407de
@ -36,9 +36,9 @@ fn shells(args: CommandArgs, _registry: &CommandRegistry) -> Result<OutputStream
|
|||||||
let mut dict = TaggedDictBuilder::new(&tag);
|
let mut dict = TaggedDictBuilder::new(&tag);
|
||||||
|
|
||||||
if index == (*args.shell_manager.current_shell).load(Ordering::SeqCst) {
|
if index == (*args.shell_manager.current_shell).load(Ordering::SeqCst) {
|
||||||
dict.insert_untagged(" ", "X".to_string());
|
dict.insert_untagged("active", "X".to_string());
|
||||||
} else {
|
} else {
|
||||||
dict.insert_untagged(" ", " ".to_string());
|
dict.insert_untagged("active", " ".to_string());
|
||||||
}
|
}
|
||||||
dict.insert_untagged("name", shell.name());
|
dict.insert_untagged("name", shell.name());
|
||||||
dict.insert_untagged("path", shell.path());
|
dict.insert_untagged("path", shell.path());
|
||||||
|
@ -164,7 +164,7 @@ fn evaluate_reference(
|
|||||||
match name {
|
match name {
|
||||||
hir::Variable::It(_) => Ok(scope.it.value.clone().into_value(tag)),
|
hir::Variable::It(_) => Ok(scope.it.value.clone().into_value(tag)),
|
||||||
hir::Variable::Other(_, span) => match span.slice(source) {
|
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
|
x => Ok(scope
|
||||||
.vars
|
.vars
|
||||||
.get(x)
|
.get(x)
|
||||||
|
@ -192,6 +192,7 @@ fn parse_full_column_path(lite_arg: &Spanned<String>) -> (SpannedExpression, Opt
|
|||||||
|
|
||||||
if head.is_none() {
|
if head.is_none() {
|
||||||
if current_part.starts_with('$') {
|
if current_part.starts_with('$') {
|
||||||
|
// We have the variable head
|
||||||
head = Some(Expression::variable(current_part, lite_arg.span));
|
head = Some(Expression::variable(current_part, lite_arg.span));
|
||||||
} else if let Ok(row_number) = current_part.parse::<u64>() {
|
} else if let Ok(row_number) = current_part.parse::<u64>() {
|
||||||
output.push(
|
output.push(
|
||||||
|
Loading…
Reference in New Issue
Block a user