KevinSilvester/wezterm-config

Using this config on macOS doesn't correctly load the shell.

Closed this issue ยท 9 comments

I'm on macOS version 14.3.1, and I'm using the system's default zsh.
image
The commands configured in the zsh environment variables are no longer working properly.

elseif platform.is_mac then
   options.default_prog = { '/bin/zsh' }
   options.launch_menu = {
      { label = 'Bash', args = { 'bash' } },
      { label = 'Fish', args = { '/opt/homebrew/bin/fish' } },
      { label = 'Nushell', args = { '/opt/homebrew/bin/nu' } },
      { label = 'Zsh', args = { 'zsh' } },
   }

you didn't install go and starship on your system so everything brokes.

I have already installed them.

I'm experiencing 'not found' errors for many commands that I've already installed. even brew is showing 'not found'.

solved.

I'm experiencing 'not found' errors for many commands that I've already installed. even brew is showing 'not found'.

I have the same issue, could you please tell me how you solved it?

I'm experiencing 'not found' errors for many commands that I've already installed. even brew is showing 'not found'.

I have the same issue, could you please tell me how you solved it?

image

like this, remove options.default_prog

thx, solved it !

Hey guys,
I think the root cause of these issues is a mistake on my part and how I defined the launch args for shells on UNIX systems. ๐Ÿ˜“

On UNIX systems, the -l flag is required to tell the shell to execute the system-wide + user-specific login scripts (e.g. ~/.bashrc, ~/.profile, /etc/bashrc, /etc/profile) before starting the shell.

This may have been why some programs (go, starship) were missing from the $PATH when launching with the default shell.

I've updated the launch_menu and default_prog options for Linux and Mac to include the login flag.
Hopefully, that will let you use your preferred shell without any issues.

local platform = require('utils.platform')()
local options = {
default_prog = {},
launch_menu = {},
}
if platform.is_win then
options.default_prog = { 'pwsh' }
options.launch_menu = {
{ label = 'PowerShell Core', args = { 'pwsh' } },
{ label = 'PowerShell Desktop', args = { 'powershell' } },
{ label = 'Command Prompt', args = { 'cmd' } },
{ label = 'Nushell', args = { 'nu' } },
{
label = 'Git Bash',
args = { 'C:\\Users\\kevin\\scoop\\apps\\git\\current\\bin\\bash.exe' },
},
}
elseif platform.is_mac then
options.default_prog = { '/opt/homebrew/bin/fish', '-l' }
options.launch_menu = {
{ label = 'Bash', args = { 'bash', '-l' } },
{ label = 'Fish', args = { '/opt/homebrew/bin/fish', '-l' } },
{ label = 'Nushell', args = { '/opt/homebrew/bin/nu', '-l' } },
{ label = 'Zsh', args = { 'zsh', '-l' } },
}
elseif platform.is_linux then
options.default_prog = { 'fish', '-l' }
options.launch_menu = {
{ label = 'Bash', args = { 'bash', '-l' } },
{ label = 'Fish', args = { 'fish', '-l' } },
{ label = 'Zsh', args = { 'zsh', '-l' } },
}
end

@KevinSilvester Great, I will update ! thx your dotsfiles