mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-13 09:24:03 +08:00
8bf8b10f68
See the changelog additions for user-visible changes. Since we enable/disable terminal protocols whenever we pass terminal ownership, tests can no longer run in parallel on the same terminal. For the same reason, readline shortcuts in the gdb REPL will not work anymore. As a remedy, use gdbserver, or lobby for CSI u support in libreadline. Add sleep to some tests, otherwise they fall (both in CI and locally). There are two weird failures on FreeBSD remaining, disable them for now https://github.com/fish-shell/fish-shell/pull/10359/checks?check_run_id=23330096362 Design and implementation borrows heavily from Kakoune. In future, we should try to implement more of the kitty progressive enhancements. Closes #10359
46 lines
812 B
Fish
46 lines
812 B
Fish
# RUN: %fish %s | %filter-ctrlseqs
|
|
|
|
# A for-loop-variable is a local variable in the enclosing scope.
|
|
set -g i global
|
|
# implicit set -l i $i
|
|
for i in local
|
|
end
|
|
set -ql i && echo $i
|
|
# CHECK: local
|
|
|
|
# The loop variable is initialized with any previous value.
|
|
set -g j global
|
|
for j in
|
|
end
|
|
set -ql j && echo $j
|
|
# CHECK: global
|
|
|
|
# Loop variables exist only locally in the enclosing local scope.
|
|
# They do not modify other local/global/universal variables.
|
|
set -g k global
|
|
begin
|
|
for k in local1
|
|
echo $k
|
|
# CHECK: local1
|
|
for k in local2
|
|
end
|
|
echo $k
|
|
# CHECK: local2
|
|
end
|
|
echo $k
|
|
# CHECK: local1
|
|
end
|
|
echo $k
|
|
# CHECK: global
|
|
|
|
function foo --on-variable foo
|
|
echo foo set
|
|
end
|
|
|
|
for foo in 1 2 3
|
|
true
|
|
end
|
|
# CHECK: foo set
|
|
# CHECK: foo set
|
|
# CHECK: foo set
|