fish-shell / fish-shell

The user-friendly command line shell.

Home Page:https://fishshell.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Variable scope-local to for loop gets carried over loop iteration

t-nil opened this issue · comments

Fish v3.7.1, tested with clean home.

https://asciinema.org/a/jZhHcUByvJ80NkbRp75krG8x4

When set -l var'ing in a loop, the variable stays set in the following loop iterations.

Expected

Like in example 2 with the explicit begin; …; end I would expect the variable to go out of scope in every loop iteration (as is the case with any major programming language today AFAIK).