How to config chat window Go version

Hi Guys,
I am using the latest version of cursor. My terminal shows that I am using go version 1.23.2, but when I execute it in the chat window, the go version becomes 1.14.12. How do I configure it to keep the go version at 1.23.2? If need more configure information, please fell to free let me know, thank you very much.
Please check the following pciture:

Hi,

it seems that your Cursor shell has different version of Go in its path most likely.

See following post how to identify the shell, adjust that shell to have the same go version in path.

Sorry, I did not see any solution in this post. What need me to do?

In the terminal shell, the PATH to go runtime is different.

Check in both terminals the PATH variable to see if they match

echo $PATH

If they are not the same, then you need to adjust the myuser-cursor-zsh/.zshrc file to point to the same go path.

 Which Go:
            Terminal in Cursor:

dennis@DENNISZGYU-MB1 intlsdk_redis_ops % which go
/Users/dennis/go/go1.23.2/bin/go

            Chat bash block:
                /usr/local/go/bin/go

echo $PATH:

Terminal in Cursor:

echo $PATH
/Users/dennis/go/go1.23.2/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/go/bin:/Users/dennis/go/go1.23.2/bin

Chat bash block:

empty, nothing response.
PS /Users/dennis/Documents/PNT/Code/intlsdk_redis_ops> echo $PATH
PS /Users/dennis/Documents/PNT/Code/intlsdk_redis_ops>

I’m newbeing with Cursor. Can you tel me the path about .zshrc file, my use root path: /Users/dennis

@danperks could you please have a look if there is something shell specific that influences the different Go version?

Anybody can help? It’s blocking me development work… :face_with_bags_under_eyes:
@T1000 @danperks

Hey, it might be possible that you have two versions of Go installed on your computer. I noticed that you’re using the zsh shell in the main terminal and bash in the chat, which might be causing the issue.

The screenshot shows different versions of Go being used:

  • In the bash terminal: go 1.14.12
  • When working with modules: trying to use go 1.23.2

Most likely, you indeed have two versions of Go installed, and different shells are using different environment settings. The main terminal uses zsh, and the chat uses bash, causing the conflict.

Solution:

  1. Check the which go command in both shells
  2. Compare the outputs of echo $PATH and echo $GOROOT
  3. Align the settings in .bashrc and .zshrc to use the same version of Go
  4. If you’re using a Go version manager (goenv, gvm, etc.), ensure it’s initialized in both shells

This is a common issue when using multiple shells with different configuration files.

Hello! Where is the .zshrc file? I saved .bashrc and .zshrc at User’s home path with following value:
cat ~/.zshrc
alias ll=“ls -l”

export GOROOT=‘/Users/dennis/go/go1.23.2’

But the problem is still not solved.

Thanks everyone, this problem was fixed by following config:


“terminal.integrated.defaultProfile.osx”: “bash”
This config specfical the chat block terminal use bash,

1 Like