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

[FEATURE] Support PowerShell for k3d shell #100

Closed
qiushihe opened this issue Aug 10, 2019 · 4 comments
Closed

[FEATURE] Support PowerShell for k3d shell #100

qiushihe opened this issue Aug 10, 2019 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@qiushihe
Copy link

Right now running k3d shell from a PowerShell session results in this error:

ERROR: selected shell [.] is not supported

I would like to see k3d shell support PowerShell. That is, if I run k3d shell from a PowerShell session, a sub-shell PowerShell session should be created (much like running bash inside bash) with KUBECONFIG environment variable already set to the correct value and have the name of the k3s cluster prepended to the shell's prompt.

Right now as a workaround I run this command:

> PowerShell -NoExit -Command {function prompt {"($([regex]::Match($(k3d get-kubeconfig), '([^/]+)\/kubeconfig\.yaml$').captures.groups[1].value)) PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "} [Environment]::SetEnvironmentVariable("KUBECONFIG", (k3d get-kubeconfig), "Process")}

... which does exactly what I wanted k3d shell in PowerShell to do. It would be nice if k3d shell can have that built in.

@qiushihe qiushihe added the enhancement New feature or request label Aug 10, 2019
@andyz-dev
Copy link
Contributor

Thanks for the suggestion. It sounds useful. PR welcome!

@andyz-dev andyz-dev added the help wanted Extra attention is needed label Aug 12, 2019
@iwilltry42
Copy link
Member

@qiushihe Out of curiosity... which docker are you using? Docker Toolbox for Windows or a remote docker or ...?

@qiushihe
Copy link
Author

qiushihe commented Sep 3, 2019

@iwilltry42 I use Docker for Windows (i.e. with HyperV).

@iwilltry42 iwilltry42 added the good first issue Good for newcomers label Feb 17, 2020
@iwilltry42
Copy link
Member

We actually dropped k3d shell with k3d v3. If you think there's still a real need for it, please open a new feature request for v4 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants