wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

macOS PATH instructions: Should PATH be a string?

Open schlich opened this issue 1 year ago • 3 comments

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.

schlich avatar Aug 15 '24 08:08 schlich

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 avatar Aug 18 '24 05:08 tjex

@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 avatar Aug 19 '24 21:08 schlich

@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

tjex avatar Aug 20 '24 08:08 tjex

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.

github-actions[bot] avatar Oct 16 '24 03:10 github-actions[bot]