I am getting this Argument list too long
error whenever, I run any command in VS code.
All commands are working in the Linux default terminal but nothing is working in VS code terminal.
I read a few solutions but I didn't understand all of them. Those are:
Remove the entire directory and recreate it.
Mass delete files using the find method?
Change the limit using the command - ulimit -s <any_number_greater_than_current_limit>
I checked my max limit of arguments, using those two commands-
What am I doing wrong or misunderstood?
As I mentioned in the question, I tried several ways which didn't work for me.
In my case, I checked the .bashrc
file and found that the PATH
variable was exported almost 10000+ times like that-
export PATH="$PATH:$HOME/.composer/vendor/bin/
export PATH="$PATH:$HOME/.composer/vendor/bin/
export PATH="$PATH:$HOME/.composer/vendor/bin/
export PATH="$PATH:$HOME/.composer/vendor/bin/
...
...
...
That is what consumed the space and make the memory full to run any further commands even with 0 arguments.
I removed all and added the following script to define PATH
only when not added already.
[[ $PATH =~ (^|.*:)"$HOME/.composer/vendor/bin"($|:.*) ]] || PATH=$PATH:$HOME/.composer/vendor/bin
I reload the shell then and it worked.
Thanks, @CharlesDuffy for your suggestions.