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

tab-completion displayed wrong character in zsh #1254

Closed
aliuq opened this issue Jul 27, 2022 · 6 comments
Closed

tab-completion displayed wrong character in zsh #1254

aliuq opened this issue Jul 27, 2022 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@aliuq
Copy link

aliuq commented Jul 27, 2022

What happened:

image

What you expected to happen:

Display the right

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Kubernetes client and server versions (use kubectl version): v1.23.9+k3s1
  • OS (e.g: cat /etc/os-release): Linux 5.18.14-1.el7.elrepo.x86_64
  • zsh config: .zshrc
@aliuq aliuq added the kind/bug Categorizes issue or PR as related to a bug. label Jul 27, 2022
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jul 27, 2022
@k8s-ci-robot
Copy link
Contributor

@aliuq: This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@aliuq aliuq changed the title tab-completion displayed wrong charcter in zsh tab-completion displayed wrong character in zsh Jul 27, 2022
@marckhouzam
Copy link
Member

@aliuq this looks similar as the problem reported in kubernetes/kubernetes#105587. It was caused by the use of zsh 5.0.x. Is that your case? Zsh 5.1 or higher doesn't have the problem. The problem has also been fixed in Cobra but has not yet been incorporated in kubectl.

Please let us know if this is the problem for you as well.

@marckhouzam
Copy link
Member

For info, here is the fix in Cobra: spf13/cobra#1665

@aliuq
Copy link
Author

aliuq commented Jul 27, 2022

@marckhouzam thanks for your reply, I will try upgrade zsh now

@aliuq
Copy link
Author

aliuq commented Jul 27, 2022

upgrade zsh version can fixed it.

@aliuq aliuq closed this as completed Jul 27, 2022
@brneto
Copy link
Contributor

brneto commented Sep 10, 2022

I've created the PR #112362 to fix this issue, but for those still facing this issue after installing Oh My Zsh with kubectl plugin enabled you can run the command below as a patch to fix it in the meantime:

sed -i '6i\    sed -i '\''s/tab=$(printf \x27\\t\x27)/tab="$(printf \x27\\t\x27)"/'\'' "$ZSH_CACHE_DIR/completions/_kubectl"\' ~/.oh-my-zsh/plugins/kubectl/kubectl.plugin.zsh && \
sed -i '9i\    sed -i '\''s/tab=$(printf \x27\\t\x27)/tab="$(printf \x27\\t\x27)"/'\'' "$ZSH_CACHE_DIR/completions/_kubectl"\' ~/.oh-my-zsh/plugins/kubectl/kubectl.plugin.zsh && \
sed -i '12i\    sed -i '\''s/tab=$(printf \x27\\t\x27)/tab="$(printf \x27\\t\x27)"/'\'' "$ZSH_CACHE_DIR/completions/_kubectl"\' ~/.oh-my-zsh/plugins/kubectl/kubectl.plugin.zsh && \
exec zsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants