Segment creation and what it should output #1891
Answered
by
estruyf
estruyf
asked this question in
Troubleshoot
-
Hi all, I just started creating my first segment and like this, all is a bit new to me, I hope you could help me out. Using the code sample provided in the docs (https://ohmyposh.dev/docs/contributing_segment), there is a My configuration looks as follows: {
"type": "npm",
"style": "plain",
"foreground": "#193549",
"background": "#ffeb3b",
"properties": {
"newprop": "Hello"
}
} This is what it renders: Questions
|
Beta Was this translation helpful? Give feedback.
Answered by
estruyf
Mar 10, 2022
Replies: 1 comment 1 reply
-
Or should the segment func (n *Npm) Init(props properties.Properties, env environment.Environment) {
n.props = props
n.env = env
n.Text = props.GetString(NewProp, "Hello")
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
estruyf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or should the segment
Init
method be: