mirror of
https://github.com/nushell/nushell
synced 2025-01-14 14:14:13 +00:00
remove $nu.cwd
(#4824)
This commit is contained in:
parent
005301647a
commit
ccc85a2979
3 changed files with 4 additions and 10 deletions
|
@ -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
|
||||
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 shorthand path to retrieve only the cell data inside the "cwd" column.
|
||||
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 "PWD" column.
|
||||
```
|
||||
(ls).name.4
|
||||
```
|
||||
|
|
|
@ -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_vals.push(create_scope(engine_state, stack, span)?);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Nushell Config File
|
||||
|
||||
def create_left_prompt [] {
|
||||
let path_segment = ($nu.cwd)
|
||||
let path_segment = ($env.PWD)
|
||||
|
||||
$path_segment
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue