Revert "fix: make exec command decrement SHLVL correctly" (#14580)

Reverts nushell/nushell#14570
This commit is contained in:
Darren Schroeder
2024-12-13 18:34:33 -06:00
committed by GitHub
parent cc0616b753
commit 05ee7ea9c7
2 changed files with 1 additions and 11 deletions

View File

@ -325,7 +325,7 @@ fn main() -> Result<()> {
if engine_state.is_interactive {
let mut shlvl = engine_state
.get_env_var("SHLVL")
.map(|x| x.as_int().unwrap_or(0))
.map(|x| x.as_str().unwrap_or("0").parse::<i64>().unwrap_or(0))
.unwrap_or(0);
shlvl += 1;
engine_state.add_env_var("SHLVL".to_string(), Value::int(shlvl, Span::unknown()));