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

[UX] Fix --install-shell-completion when SKYPILOT_DEBUG is set #3642

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
from sky.usage import usage_lib
from sky.utils import common_utils
from sky.utils import controller_utils
from sky.utils import env_options
from sky.utils import dag_utils
from sky.utils import log_utils
from sky.utils import resources_utils
Expand Down Expand Up @@ -362,8 +363,9 @@ def _install_shell_completion(ctx: click.Context, param: click.Parameter,
bashrc_diff = ('\n# For SkyPilot shell completion'
'\n. ~/.sky/.sky-complete.bash')

unset_debug = f'unset {env_options.Options.SHOW_DEBUG_INFO.value}; '
if value == 'bash':
install_cmd = f'_SKY_COMPLETE=bash_source sky > \
install_cmd = f'{unset_debug}_SKY_COMPLETE=bash_source sky > \
~/.sky/.sky-complete.bash && \
echo "{bashrc_diff}" >> ~/.bashrc'

Expand All @@ -372,13 +374,13 @@ def _install_shell_completion(ctx: click.Context, param: click.Parameter,
reload_cmd = _RELOAD_BASH_CMD

elif value == 'fish':
cmd = '_SKY_COMPLETE=fish_source sky > \
~/.config/fish/completions/sky.fish'
cmd = (f'{unset_debug}_SKY_COMPLETE=fish_source sky > '
'~/.config/fish/completions/sky.fish')

reload_cmd = _RELOAD_FISH_CMD

elif value == 'zsh':
install_cmd = f'_SKY_COMPLETE=zsh_source sky > \
install_cmd = f'{unset_debug}_SKY_COMPLETE=zsh_source sky > \
~/.sky/.sky-complete.zsh && \
echo "{zshrc_diff}" >> ~/.zshrc'

Expand Down
Loading