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

occassional occurred information from terminal #752

Closed
appleyuchi opened this issue Jul 19, 2020 · 9 comments
Closed

occassional occurred information from terminal #752

appleyuchi opened this issue Jul 19, 2020 · 9 comments
Labels

Comments

@appleyuchi
Copy link

appleyuchi commented Jul 19, 2020

问题

I often get the information in terminal:

build_prompt:1: scalar parameter RETVAL created globally in function build_prompt
build_prompt:2: scalar parameter segment created globally in function build_prompt

I don't know how to reproduce it 100%,it just occur occasionally.
Could anyone tell me what happened to my terminal?

A similar issue is found in #438
but they are different

@danielshahaf
Copy link
Member

And what makes you think this issue has anything to do with zsh-syntax-highlighting? There's no build_prompt function in zsh-syntax-highlighting. Looks like you should follow up with whoever wrote that function.

$funcfiletrace and friends may be helpful in tracking that one down.

The warning is generated by the warncreateglobal option.

@appleyuchi
Copy link
Author

appleyuchi commented Jul 19, 2020

And what makes you think this issue has anything to do with zsh-syntax-highlighting? There's no build_prompt function in zsh-syntax-highlighting. Looks like you should follow up with whoever wrote that function.

$funcfiletrace and friends may be helpful in tracking that one down.

The warning is generated by the warncreateglobal option.

I'm not sure,the reason why I post it here is that
#438 also has build_prompt....
sorry if I put it at the wrong place

@appleyuchi
Copy link
Author

could you tell me where should I post it?
I'm weak in zsh,
do you know how to fix it?
it's annoying,
Thanks for your help~!

@danielshahaf
Copy link
Member

danielshahaf commented Jul 19, 2020

You should post this to whoever wrote build_prompt.

I don't know who that is. To find out, you can either grep your dotfiles, or set PS4=%x:$PS4 and then the error message will include the filename.

@danielshahaf
Copy link
Member

Actually, forget about PS4; it won't help here. My bad.

@danielshahaf
Copy link
Member

Note to self: see about exposing a function definition's file:line coordinates via zsh/parameter. The info must be available already, because it's copied into the C funcstack struct at function calls.

@danielshahaf
Copy link
Member

Ah, turns out that already exists.

@appleyuchi Run print -r -- ${functions_source[build_prompt]}. That should print the name of the file that defines build_prompt. Tell the author of that file their function isn't WARN_CREATE_GLOBAL-clean. Good luck!

@appleyuchi
Copy link
Author

Thanks for
your help。。。。I have fixed for RETVAL
but I can not fixed it for segment.
because segment is defined in a for-loop

@danielshahaf
Copy link
Member

I'm afraid we can't help you with that. The zsh-syntax-highlighting issue tracker is not a support forum for arbitrary issues involving arbitrary plugins. Feel free to follow up with the third-party plugin maintainer — I see you've created an issue already (caiogondim/bullet-train.zsh#326) — or with the zsh support forums (#zsh on Freenode and the zsh-users@ list). In the latter case, don't forget to link to the relevant source code.

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants