Background
I want to redirect the result of a one-liner shell script to a file on a terminal in the GitHub Codespaces environment.
For example, when I executed the following one-liner in the Terminal view of VSCode:
$ for i in 1 2 3; do echo $i; done
I got the following result:
Problem
When I redirected the result of the same one-liner:
$ for i in 1 2 3; do echo $i; done > foo.txt
I got the foo.txt
like this. It contains escape sequences and the for ... in
clause of the one-liner:
]633;C]633;E;for\x20i\x20in\x201\x202\x2031
2
3
When I ran the same one-liner in my WSL2 environment, the result didn't contain these headings.
Question
How can I stop the redirected output containing the for in
clause on the GitHub Codespaces environment?