i use fish 4.0.0 on debian 12.9.
after updating fish 3.7.1 to 4.0.0 one of my tools written in fish started giving wrong, strange results.
finally i have isolated the problem and confirmed it does not happen with v3.7.1 (which i temporarily reinstalled for confirmation): when the output of a fish script is redirected to a file, five bytes are added at the start and at the end of the file. both sequences start with an ANSI escape code.
bytes added at the start of the file:
bytes added at the end of the file:
the problem can be reproduced with this "hello.fish":
#!/usr/bin/env fish
# hello.fish
echo hello
./hello.fish # good output to screen
./hello.fish > hello.txt # wrong output to file
first i suspected the problem lies with echo, but the same happens with this "ls.fish":
#!/usr/bin/env fish
# ls.fish
ls
./ls.fish # good output to screen
./ls.fish > ls.txt # wrong output to file
it seems a bug. anyway i've searched the changes of fish 4.0.0, just in case i missed something, but found nothing.
i use fish 4.0.0 on debian 12.9.
after updating fish 3.7.1 to 4.0.0 one of my tools written in fish started giving wrong, strange results.
finally i have isolated the problem and confirmed it does not happen with v3.7.1 (which i temporarily reinstalled for confirmation): when the output of a fish script is redirected to a file, five bytes are added at the start and at the end of the file. both sequences start with an ANSI escape code.
bytes added at the start of the file:
bytes added at the end of the file:
the problem can be reproduced with this "hello.fish":
first i suspected the problem lies with
echo, but the same happens with this "ls.fish":it seems a bug. anyway i've searched the changes of fish 4.0.0, just in case i missed something, but found nothing.