powerline-shell icon indicating copy to clipboard operation
powerline-shell copied to clipboard

Check if env exists before add to powerline

Open versatran01 opened this issue 5 years ago • 3 comments

currently if env var not set it displays None.

versatran01 avatar Jul 15 '19 05:07 versatran01

Confirm, none is displayed. To be clear, your suggesting that nothing show? I would suggest that you be able to overwrite the default value.

jceaser avatar Jul 24 '19 01:07 jceaser

I support this feature request.

It would be great if the segment could be omitted if the env is not set.

But of cause it would be nice to have an option to define if you want no segment, or <default>.

I think the definition could look like this:

    {
      "type": "env",
      "var": "STY",
      "skip_if_not_set": "false",
      "default": "nothing to see here"
    },
    {
      "type": "env",
      "var": "STY",
      "skip_if_not_set": "true"
    },

CWempe avatar Nov 03 '19 15:11 CWempe

Now I see: If I do not define default, the segment is omitted.

So your changes are working as we wanted. Thanks.

~~I would suggest you create a pull request to integrate this into the official project.~~ https://github.com/b-ryan/powerline-shell/pull/470

CWempe avatar Nov 03 '19 16:11 CWempe