justjanne / powerline-go

A beautiful and useful low-latency prompt for your shell, written in go
GNU General Public License v3.0
2.73k stars 268 forks source link

Docker context segment doesn't seem to recognize DOCKER_CONTEXT environment variable #350

Closed scottslowe closed 2 years ago

scottslowe commented 2 years ago

Describe the bug The Docker context segment does not appear to recognize the DOCKER_CONTEXT environment variable, which is another way to specify the context that the Docker CLI should use.

To Reproduce Steps to reproduce the behavior:

  1. Create a new Docker context (I used an SSH-based context to a Linux system with the Docker daemon installed).
  2. Run docker context use <new-context>. You should see a new segment show up in the prompt.
  3. Run docker context use default. The new segment will disappear.
  4. Run export DOCKER_CONTEXT=<new-context>. Note that no new segment appears in the prompt, even though the Docker CLI is correctly using the context (and docker context ls will show the specified context as the active one).

Expected behavior I expected the Docker context segment to appear in the prompt when the DOCKER_CONTEXT environment variable is defined. This behavior is similar to the behavior of the segment that displays the name of the AWS CLI profile when the AWS_PROFILE environment variable is defined.

Environment (please complete the following information):

Additional context None