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

Command prompt is broken when using zim on zshell #87

Closed
c10l opened this issue Nov 5, 2021 · 3 comments · Fixed by #192
Closed

Command prompt is broken when using zim on zshell #87

c10l opened this issue Nov 5, 2021 · 3 comments · Fixed by #192

Comments

@c10l
Copy link
Contributor

c10l commented Nov 5, 2021

I've recently migrated my zsh config to use zim. Unfortunately, this broke kubie because it expects to find certain files in known locations:

$ kubie ctx
/Users/c10l/.zshrc:source:102: no such file or directory: /var/folders/2l/z3r2cq7j3hd79c4091tq42hr0000gn/T/.tmpc9w8CC/.zim/zimfw.zsh
/Users/c10l/.zshrc:source:104: no such file or directory: /var/folders/2l/z3r2cq7j3hd79c4091tq42hr0000gn/T/.tmpc9w8CC/.zim/init.zsh
/Users/c10l/.zlogin:source:7: no such file or directory: /var/folders/2l/z3r2cq7j3hd79c4091tq42hr0000gn/T/.tmpc9w8CC/.zim/login_init.zsh
c10l@laptop ~ %

I managed to work around those errors by setting ZIM_HOME=/Users/c10l/.zim but then something else broke as it tries to find .zimrc under $HOME, which is overridden at that point to the kubie temp dir:

$ kubie ctx
_zimfw_source_zimrc:source:3: no such file or directory: /var/folders/2l/z3r2cq7j3hd79c4091tq42hr0000gn/T/.tmp7RzL0l/.zimrc
Failed to source /var/folders/2l/z3r2cq7j3hd79c4091tq42hr0000gn/T/.tmp7RzL0l/.zimrc
/Users/c10l/.zim/modules/ohmyzsh/plugins/kubectl/kubectl.plugin.zsh:5: read-only file system: /kubectl_completion

Suggestion: allow me to give a list of files and directories to copy to the temp dir when switching contexts. This way I can specify .zimrc and .zim/ which should make this work.

@sebastianst
Copy link

I can confirm that this is still an issue

$ kubie ctx
_zimfw_source_zimrc:source:3: no such file or directory: /tmp/.tmpyj7aAo/.zimrc
Failed to source /tmp/.tmpyj7aAo/.zimrc
_zimfw_source_zimrc:source:3: no such file or directory: /tmp/.tmpyj7aAo/.zimrc
Failed to source /tmp/.tmpyj7aAo/.zimrc
/home/seb/.zshrc:source:114: no such file or directory: /tmp/.tmpyj7aAo/.zim/init.zsh
/home/seb/.aliases:unalias:76: no such hash table element: gt

@brianclin
Copy link

brianclin commented May 20, 2023

kubie overrides the ZDOTDIR variable with the temp path and zim looks for .zimrc file in ${ZDOTDIR}/.zimrc when the variable is defined.

Zim Settings

Assuming your .zimrc file is in $HOME: you can add export ZIM_CONFIG_FILE=$HOME/.zimrc to your .zshrc

This should lead to no errors from kubie.

@sebastianst
Copy link

Thanks, this works!

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

Successfully merging a pull request may close this issue.

3 participants