remove $nu.cwd (#4824)

This commit is contained in:
Darren Schroeder 2022-03-12 09:11:19 -06:00 committed by GitHub
parent 005301647a
commit ccc85a2979
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 10 deletions

View file

@ -368,10 +368,10 @@ rows, columns, or cells inside of the table.
Shorthand paths are made from rows numbers, column names, or both. You can use Shorthand paths are made from rows numbers, column names, or both. You can use
them on any variable or subexpression. them on any variable or subexpression.
``` ```
$nu.cwd $env.PWD
``` ```
The above accesses the built-in `$nu` variable, gets its table, and then uses The above accesses the built-in `$env` variable, gets its table, and then uses
the shorthand path to retrieve only the cell data inside the "cwd" column. the shorthand path to retrieve only the cell data inside the "PWD" column.
``` ```
(ls).name.4 (ls).name.4
``` ```

View file

@ -1125,12 +1125,6 @@ pub fn eval_variable(
} }
} }
// since the env var PWD doesn't exist on all platforms
// lets just get the current directory
let cwd = current_dir_str(engine_state, stack)?;
output_cols.push("cwd".into());
output_vals.push(Value::String { val: cwd, span });
output_cols.push("scope".into()); output_cols.push("scope".into());
output_vals.push(create_scope(engine_state, stack, span)?); output_vals.push(create_scope(engine_state, stack, span)?);

View file

@ -1,7 +1,7 @@
# Nushell Config File # Nushell Config File
def create_left_prompt [] { def create_left_prompt [] {
let path_segment = ($nu.cwd) let path_segment = ($env.PWD)
$path_segment $path_segment
} }