macOS PATH instructions: Should PATH be a string?
What page or section of the docs have an issue? FAQ
Describe the issue In the example towards the bottom, we have:
config.set_environment_variables = {
PATH = {
-- prepend the path to your utility
wezterm.home_dir
.. '/.local/bob/nvim-bin:'
-- and include the rest of the PATH
.. os.getenv 'PATH',
},
}
however, PATH is expected to be a string, and at least on my system, would throw a Lua error when the configuration was saved until this was corrected.
Yes, PATH, and all environment variables for that matter are strings.
Are you saying the code example above from the documentation is incorrect / not a string?
@tjex
Yes, PATH was interpreted as an object by the Lua parser given the example, sorry for not being clear.
Taking away the brackets and trailing comma fixed the configuration error for me.
I don't know Lua but am happy to help further clarify the error if needed
@schlich Ahh yep. I guess because it was a singular string. The brackets and a trailing comma on a singular string will suggest to lua that you're giving it a table, which is also valid, but you need to remove the last trailing comma (so brackets without the trailing comma for a singular string should still be valid).
Eg, I fill PATH with multiple strings in my conf here: https://github.com/tjex/wezterm-conf/blob/main/util.lua
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.