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

Add 🐍 to the virtualenv title so I know that's what I see #291

Closed
dwt opened this issue May 18, 2022 · 9 comments · Fixed by #325
Closed

Add 🐍 to the virtualenv title so I know that's what I see #291

dwt opened this issue May 18, 2022 · 9 comments · Fixed by #325
Labels
🚀 enhancement performance, UX or maintainability

Comments

@dwt
Copy link

dwt commented May 18, 2022

Env

Pure
4.1.1
Fish
fish, version 3.4.1
OS/distribution
uname -a
Darwin Seneca.fritz.box 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64

Problem description

I work with both virtualenvs as well as with Kubernetes a lot. Always correctly keeping track what virtualenv and what Kubernetes context and namespace is active, is really important to me.

To prevent all possible confusion, it would be very helpful if the virtualenv display could include the symbol 🐍. This allows me to distinguish the Kubernetes context and namespace with ☸️.

Proposed Solution

Would you accept a pull request for this? I have so far just edited my local config file to include this, but would like to be able to just update without having to care about this. A feature flag to hide this behind would be fine with me.

@edouard-lopez
Copy link
Member

edouard-lopez commented May 20, 2022

Hello @dwt,
Sure, PRs are welcome ❤️

Suggestion

A variable defining the symbol for each indicator could do the trick, e.g declaring

 _pure_set_default pure_symbol_virtualenv "🐍"
 _pure_set_default pure_symbol_kubernetes "☸️"

By default, I would prefer having it empty for now, to have opt-in mechanism.

Could you try to update the test as well? They are still buggy when you run them all, but you should be able to run the one related to one feature, like:

❯ make dev-pure-on FISH_VERSION=3.1.2 CMD="fishtape tests/_pure_prompt_virtualenv.test.fish"

@dwt
Copy link
Author

dwt commented May 22, 2022

Hm, that doesn't seem so easy, I'm getting hangs in the test suite with errors like this:

fish: Unknown command: _print_filename
/tmp/.pure/tests/migration-to-4.0.0.test.fish (line 1): 
_print_filename $current_filename
^
in command substitution
        called on line 2 of file /tmp/.pure/tests/migration-to-4.0.0.test.fish
/tmp/.pure/tests/migration-to-4.0.0.test.fish (line 2): Unknown command
@mesg (_print_filename $current_filename)
      ^

After that the test container just hangs indefinitely, until I manually kill the container. Any advice?

@dwt
Copy link
Author

dwt commented May 22, 2022

Scratch that, the problem was that I was running ❯ make test-pure-on FISH_VERSION=3.3.1 CMD="fishtape tests/_pure_prompt_virtualenv.test.fish" - which actually runs all the tests instead of restricting them.

@edouard-lopez edouard-lopez added the 🚀 enhancement performance, UX or maintainability label Jun 21, 2022
@edouard-lopez
Copy link
Member

I will add variable, so people can disable those features if need be:

_pure_set_default pure_enable_virtualenv true
_pure_set_default pure_enable_kubernetes true

@zonywhoop
Copy link

@edouard-lopez were you able to make any progress on this? I too am looking for this (similar) functionality but honestly don't see k8s context support in the current code base. Was that a plugin you added or something else?

@edouard-lopez
Copy link
Member

edouard-lopez commented Aug 2, 2023

Hello @zonywhoop, no progress on my side @dwt was working on a PR, I believe.

However, I see two features in this issue:

  1. add a flag to control virtualenv display and add a customizable prefix (cf. functions/_pure_prompt_container.fish)
  2. add support for k8s context + customizable prefix. There are several prompts that offer k8s support, we can get inspired by them:

I'm going to create another issue for the kubernetes one.

@edouard-lopez
Copy link
Member

@edouard-lopez
Copy link
Member

@dwt @zonywhoop
K8s support has been shipped with https://github.com/pure-fish/pure/tree/v4.6.0

@edouard-lopez
Copy link
Member

I'm working on the Python/virtualenv feature on #325

@edouard-lopez edouard-lopez reopened this Aug 21, 2023
edouard-lopez added a commit that referenced this issue Aug 21, 2023
Set to empty by default, to preserve exists user dev experience

fixes #291
edouard-lopez added a commit that referenced this issue Aug 21, 2023
Set to empty by default, to preserve exists user dev experience

fixes #291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement performance, UX or maintainability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants