-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Open
Labels
pull request wantedThis is a great way to contribute! Help us out :-DThis is a great way to contribute! Help us out :-Dshell alias clobberingAnything dealing with users shadowing builtins with aliases or functions.Anything dealing with users shadowing builtins with aliases or functions.shell: zshshell: zsh: oh-my-zsh
Description
Operating system and version: macOs Catalina 10.15.7
nvm debug
output:
$ nvm debug
nvm --version: v0.37.0
$TERM_PROGRAM: iTerm.app
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'tk'
${HOME}: /Users/tk
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${NVM_DIR}/versions/node/v14.15.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:${HOME}/Library/Android/sdk/emulator:${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/tools/bin:${HOME}/Library/Android/sdk/platform-tools:${HOME}/Library/Android/sdk/emulator:${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/tools/bin:${HOME}/Library/Android/sdk/platform-tools:${HOME}/Library/Android/sdk/emulator:${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/tools/bin:${HOME}/Library/Android/sdk/platform-tools
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.7.1 (x86_64-apple-darwin19.0)'
uname -a: 'Darwin 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64'
sha256sum
checksum binary: 'sha256sum'
sw_vers
OS version: Mac 10.15.7 19H2
curl
curl
curl
curl
curl
curl
curl: , curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2
wget
wget
wget
wget
wget
wget
nvm:187: command not found: wget
wget: ,
sed
sed
sed
sed
sed
sed
sed:
cut
cut
cut
cut
cut
cut
cut:
basename
basename
basename
basename
basename
basename
basename:
rm
rm
rm
rm
rm
rm
rm:
mkdir
mkdir
mkdir
mkdir
mkdir
mkdir
mkdir:
xargs
xargs
xargs
xargs
xargs
xargs
xargs:
git
git
git
git
git
git
ls: : No such file or directory
git
git
git
git
git
git: , git version 2.29.2
grep
grep
grep
grep
grep
grep
ls: : No such file or directory
^G^R
sha256sum
sw_vers
curl
curl
curl
curl
curl
curl
wget
wget
wget
wget
wget
wget
sed
sed
sed
sed
sed
sed
cut
cut
cut
cut
cut
cut
basename
basename
basename
basename
basename
basename
rm
rm
rm
rm
rm
rm
mkdir
mkdir
mkdir
mkdir
mkdir
mkdir
xargs
xargs
xargs
xargs
xargs
xargs
git
git
git
git
git
git
git
git
git
git
git
grep
grep
grep
grep
grep
grep
^G^E^P
grep
grep
^G^R
sha256sum
sw_vers
curl
curl
curl
curl
curl
curl
wget
wget
wget
wget
wget
wget
sed
sed
sed
sed
sed
sed
cut
cut
cut
cut
cut
cut
basename
basename
basename
basename
basename
basename
rm
rm
rm
rm
rm
rm
mkdir
mkdir
mkdir
mkdir
mkdir
mkdir
xargs
xargs
xargs
xargs
xargs
xargs
git
git
git
git
git
git
git
git
git
git
git
grep
grep
grep
grep
grep
grep
^G^E^P
grep
grep
^G^E^P
grep
grep: , grep (BSD grep) 2.5.1-FreeBSD
^K
^K
awk
awk
awk
awk
ls: : No such file or directory
awk
^K
^K
awk
awk
awk: , awk version 20070501
nvm current: v14.15.1
which node: ${NVM_DIR}/versions/node/v14.15.1/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v14.15.1/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v14.15.1
npm root -g: ${NVM_DIR}/versions/node/v14.15.1/lib/node_modules
~/.nvm ⌚ 20:58:11
$ sha256sum
zsh: command not found: sha256sum
~/.nvm ⌚ 20:58:11
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H2
~/.nvm ⌚ 20:58:11
$ curl
curl: try 'curl --help' or 'curl --manual' for more information
~/.nvm ⌚ 20:58:11
$ curl
curl: try 'curl --help' or 'curl --manual' for more information
~/.nvm ⌚ 20:58:11
$ curl
curl: try 'curl --help' or 'curl --manual' for more information
~/.nvm ⌚ 20:58:11
$ curl
curl: try 'curl --help' or 'curl --manual' for more information
~/.nvm ⌚ 20:58:11
$ curl
curl: try 'curl --help' or 'curl --manual' for more information
~/.nvm ⌚ 20:58:11
$ curl
curl: try 'curl --help' or 'curl --manual' for more information
~/.nvm ⌚ 20:58:11
$ wget
zsh: command not found: wget
~/.nvm ⌚ 20:58:11
$ wget
zsh: command not found: wget
~/.nvm ⌚ 20:58:11
$ wget
zsh: command not found: wget
~/.nvm ⌚ 20:58:11
$ wget
zsh: command not found: wget
~/.nvm ⌚ 20:58:11
$ wget
zsh: command not found: wget
~/.nvm ⌚ 20:58:11
$ wget
zsh: command not found: wget
~/.nvm ⌚ 20:58:12
$ sed
sed
sed
sed
sed
sed
cut
cut
cut
cut
cut
cut
basename
basename
basename
basename
basename
basename
rm
rm
rm
rm
rm
rm
mkdir
mkdir
mkdir
mkdir
mkdir
mkdir
xargs
xargs
xargs
xargs
xargs
xargs
git
git
git
git
git
git
git
git
git
git
git
grep
grep
grep
grep
grep
grep
^G^E^P
grep
grep
^G^E^P
grep
^K
^K
awk
awk
awk
awk
awk
^K
^K
awk
awk
sed
sed
sed
sed
sed
cut
cut
cut
cut
cut
cut
basename
basename
basename
basename
basename
basename
rm
rm
rm
rm
rm
rm
mkdir
mkdir
mkdir
mkdir
mkdir
mkdir
xargs
xargs
xargs
xargs
xargs
xargs
git
git
git
git
git
git
git
git
git
git
git
grep
grep
grep
grep
grep
nvm ls
output:
$ nvm ls
tput
-> v14.15.1
v15.2.1
tput
default -> lts/* (-> v14.15.1)
tputtputtput
tput
node -> stable (-> v15.2.1) (default)
stable -> 15.2 (-> v15.2.1) (default)
iojs -> N/A (default)
unstable -> N/A (default)
tputtputtputtputtputtputtput
lts/* -> lts/fermium (-> v14.15.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.23.0 (-> N/A)
lts/erbium -> v12.19.1 (-> N/A)
lts/fermium -> v14.15.1
~/.nvm ⌚ 20:59:23
$ tput
usage: tput [-V] [-S] [-T term] capname
~/.nvm ⌚ 20:59:23
$ tput
usage: tput [-V] [-S] [-T term] capname
~/.nvm ⌚ 20:59:23
$ tputtputtput
zsh: command not found: tputtputtput
~/.nvm ⌚ 20:59:23
$
~/.nvm ⌚ 20:59:23
$
~/.nvm ⌚ 20:59:23
$ tput
usage: tput [-V] [-S] [-T term] capname
~/.nvm ⌚ 20:59:23
$ tputtputtputtputtputtputtput
zsh: command not found: tputtputtputtputtputtputtput
~/.nvm ⌚ 20:59:23
$
~/.nvm ⌚ 20:59:23
$
~/.nvm ⌚ 20:59:23
$
~/.nvm ⌚ 20:59:23
$
~/.nvm ⌚ 20:59:23
$
~/.nvm ⌚ 20:59:23
$
~/.nvm ⌚ 20:59:23
$
How did you install nvm
?
Tried both, first with install script in readme, and then through Homebrew. Both produced the same output.
What steps did you perform?
Normal nvm commands.
What happened?
NVM seems to be working fine, it could be that only the output is messed up.
What did you expect to happen?
Output to be colored and correct in a single return.
Is there anything in any of your profile files that modifies the PATH
?
# Android Studio env variables
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
Metadata
Metadata
Assignees
Labels
pull request wantedThis is a great way to contribute! Help us out :-DThis is a great way to contribute! Help us out :-Dshell alias clobberingAnything dealing with users shadowing builtins with aliases or functions.Anything dealing with users shadowing builtins with aliases or functions.shell: zshshell: zsh: oh-my-zsh
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
ljharb commentedon Nov 20, 2020
What is
tput
?tonykaram1993 commentedon Nov 20, 2020
Your guess is as good as mine.
In my frustration, I was googling the issue and found this http://linuxcommand.org/lc3_adv_tput.php and that's why I thought it was related, cause I saw 'tput' in the terminal being output by nvm.
ljharb commentedon Nov 20, 2020
Could you perhaps share your relevant profile file(s) (with secret things redacted, ofc)?
tonykaram1993 commentedon Nov 20, 2020
The following is my .zshrc file (functions and aliases removed as they make no difference), not sure what other file you would want. Let me know and I will provide them.
ljharb commentedon Nov 21, 2020
/usr/local/opt
implies you installed nvm via homebrew, which is entirely unsupported. Even if the same thing happens, please brew uninstall, and reinstall through the proper curl/wget install script.My guess is that this is related to OMZ. What's in your
oh-my-zsh.sh
file?tonykaram1993 commentedon Nov 21, 2020
@ljharb Alright I have uninstalled it from brew and reinstalled using the script.
Here are the contents of my
oh-my-zsh.sh
file:tonykaram1993 commentedon Nov 21, 2020
Alright so I found the issue, output is now correct.
The issue was that I had a function in my .zshrc called
type
. I have scripts that auto types stuff for me:So calling
type "cd ~"
would actually simulate key presses on my keyboard that typecd ~
and then hits the enter key.I changed the name of the above function to something else and now everything works, all output is correct. It appears that nvm uses
type
or something and my function was overwriting it hence the mangled nvm output.nvm ls
now outputs the following:ljharb commentedon Nov 21, 2020
Aha, yes, type is a shell builtin. I’ll see about escaping it to ensure this doesn’t cause problems. Thanks for finding it!
[-]tput is messed up in nvm output[/-][+]`type` alias conflicts with nvm[/+]ljharb commentedon Nov 21, 2020
Ended up reverting this change since it broke some tests; i'll re-add it via PR.
[Robustness] handle an overridden `type`
type
#2356[Robustness] handle an overridden `type`
sladyn98 commentedon Mar 1, 2021
@ljharb I guess this is solved right.
ljharb commentedon Mar 1, 2021
No; #2356 is still open, and the tests are failing. Feel free to post a link to a branch in the PR and I’ll pull in your changes.
[Robustness] handle an overridden `type`
[Robustness] handle an overridden `type`
[Robustness] handle an overridden `type`