Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read-only variable: ZVM_NAME #9

Closed
mskar opened this issue Feb 1, 2021 · 9 comments
Closed

read-only variable: ZVM_NAME #9

mskar opened this issue Feb 1, 2021 · 9 comments
Assignees
Labels
question Further information is requested

Comments

@mskar
Copy link

mskar commented Feb 1, 2021

What does this mean?

~/.zsh-vi-mode/zsh-vi-mode.zsh:100: read-only variable: ZVM_NAME

How can I avoid this message upon shell startup?

@jeffreytse
Copy link
Owner

jeffreytse commented Feb 2, 2021

Hi @mskar

Could you provide the instructions about how you loaded this plugin? Especially, the context around the source line.

Thanks and regards

@jeffreytse jeffreytse self-assigned this Feb 2, 2021
@jeffreytse jeffreytse added the question Further information is requested label Feb 2, 2021
@mskar
Copy link
Author

mskar commented Feb 2, 2021

I cloned and sourced the plugin:

git clone https://github.com/jeffreytse/zsh-vi-mode.git $HOME/.zsh-vi-mode
source $HOME/.zsh-vi-mode/zsh-vi-mode.plugin.zsh

I think I will have to use the process of elimination to see which line(s) in my .zshrc is/are causing the problem.

@jeffreytse
Copy link
Owner

jeffreytse commented Feb 2, 2021

Hi @mskar

👍 You are right, to use the process of elimination to see the problem. Any progress, please share to here, in case of it could help other people.

Thanks and regards

@GerardKetuma
Copy link

I'm also having this issue. Get this on the terminal when I run source
~/.oh-my-zsh/custom/plugins/zsh-vi-mode/zsh-vi-mode.zsh:105: read-only variable: ZVM_NAME

Line 105 of zsh-vi-mode.zsh is below:
typeset -gr ZVM_NAME='zsh-vi-mode'

It seems that ZVM_NAME cannot be set for some reason.

@mskar
Copy link
Author

mskar commented Feb 8, 2021

Could it be an OS-specific issue?
@GerardKetuma, do you also use MacOS?
What if we remove the -r option from line 105?
typeset -g ZVM_NAME='zsh-vi-mode'
https://opensource.apple.com/source/zsh/zsh-65/zsh/Doc/help/typeset.auto.html
If that doesn't work, maybe we can use export instead of typeset to set ZVM_NAME?

@GerardKetuma
Copy link

Could it be an OS-specific issue?
@GerardKetuma, do you also use MacOS?
What if we remove the -r option from line 105?
typeset -g ZVM_NAME='zsh-vi-mode'
https://opensource.apple.com/source/zsh/zsh-65/zsh/Doc/help/typeset.auto.html
If that doesn't work, maybe we can use export instead of typeset to set ZVM_NAME?

@mskar Yes, I'm using Mac OSX.

Tried removing the -r option but still got the same error.

@jeffreytse
Copy link
Owner

Hi, @GerardKetuma @mskar

Many thanks for you guys reporting this issue and I'm so sorry for the inconvenient. Could you provide more details for me to dig this problem? Currently I have no way to reproduce it.

Thanks and regards

jeffreytse added a commit that referenced this issue Feb 17, 2021
Multiple sourcing the plugin will cause some problem such as the
readonly variable issue (#9), this feature will avoid these issues.
@jeffreytse
Copy link
Owner

Hi @GerardKetuma @mskar

The commit (cd50109) has added a new feature to avoid sourcing this plugin multiple times. Welcome to update to this plugin and give some feedback.

Thanks and regards

@mskar
Copy link
Author

mskar commented Feb 17, 2021

@jeffreytse, I think this change fixed the issue. I will close the issue now.
@GerardKetuma, if you still get the message, please let me know and I can reopen this issue.

@mskar mskar closed this as completed Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants