getting duplicate paths in my vscode integrated terminal

Viewed 149

I have written a code where I am looking for a environment variable called SQLCONFIGPATH in my computer. Then reading a config.ini file.

I went to .zprofile and the path variable. When I call the file from my integrated shell, I get the following error:

 /Users/Me/Documents/research/Home/python/my-lab/sql_config/Users/Me/Documents/research/Home/python/my-lab/sql_config/config.ini

But when I go to my regular shell (not in my vscode), I cd into the directory where the file is located and am able to call the file with no issues.
How do I call this within vscode's integrated shell? It seems there is a duplicate being created here. Also when I go into vscode's coderunner and run the file, it runs with no issues.

The code is supposed to read this path:

Users/Me/Documents/research/Home/python/my-lab/sql_config/config.ini

Thanks

1 Answers

You could fiddle with your .zshrc and .zprofile to ensure that a directory is not added redundantly to your PATH. A much easier approach would be to use a

typeset -aU path

This would ensure that zsh itself keeps duplicates out from PATH.

Related