emscripten-core / emscripten-core/emscripten
Using ZSH on MSYS2 makes ./emsdk_env.sh run carridge return as a command
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
This is a low-priority seemingly cosmetic bug, with no effects on functionality.
I have been programming with emscripten for a while now on Windwos, in the MinGW64 environment of MSYS2. I am also a `zsh` user. I have been seeing the same error for over two years now, when running `source ./emsdk_env.sh`: `(eval):1: command not found: ^M`
Strangely this only happens with `zsh`. Even without `.zshrc` present it still happens and does not happen in `bash`. Here is a video of the behavior, where I show it happening in `zsh` but not in `bash`.
https://github.com/emscripten-core/emscripten/assets/60887273/5f8ff455-9ac2-441b-a565-e9898ddc8d65
Usually `^M` indicates, that a carriage return is interpreted as a command. But strangely, that script is already properly formatted to not have `CRLF`. More strangely it only happens on `zsh` and I have never seen such a behavior with any other script I ever used. So the script or something called by it misinterprets the MSYS2 environment somehow.
Either way, this bug is of no real consequence, as I have been compiling my code with emscripten in that environment for years. Just wanted to finally mention it.
**Version of emscripten/emsdk:**
Output of emcc --version
```console
$ emcc --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.38 (9
eff02bc816c50ab0e3b70a3bd5b72a8dc2893a2)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR P
URPOSE.
```
Contributor guide
Assessment
This issue has not been assessed yet.