Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Issue with echo & source to /dev/stdin



Hi All,

My zsh has become very slow after upgrading to Mac Big Sur OS. 
It was nvm that was causing the issue. So I researched and found that nvm can be lazy loaded with the `--no-use` option.

However, even after using --no-use, it was still slow. The reason is a simple echo command to /dev/stdin. It is taking >5 seconds. Below are the lines that are causing the issue

```
[ "_$( . /dev/stdin yes 2> /dev/null <<'EOF'
[ $# -gt 0 ] && nvm_echo $1
EOF
)" = "_yes" ]
```

We noticed that even a very basic echo to /dev/stdin is taking more than 5 seconds. For example

```
time ((echo abc) | (. /dev/stdin))
/dev/stdin:1: command not found: abc
( ( echo abc; ) | ( . /dev/stdin; ); )  0.00s user 0.00s system 0% cpu 5.087 total
```

This happens only with shell built-in echo and doesn't happen with /bin/echo. 
We tried many options and a more detailed discussion can be found in the below github issue
https://github.com/nvm-sh/nvm/issues/2387

Looking forward to your help. You can directly reply in the github thread. It will help others as well.

Thanks,
Anand



Messages sorted by: Reverse Date, Date, Thread, Author