1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6303],{2180(e,t,s){s.r(t),s.d(t,{assets:()=>h,contentTitle:()=>c,default:()=>x,frontMatter:()=>d,metadata:()=>n,toc:()=>o});const n=JSON.parse('{"id":"segments/languages/crystal","title":"Crystal","description":"What","source":"@site/docs/segments/languages/crystal.mdx","sourceDirName":"segments/languages","slug":"/segments/languages/crystal","permalink":"/docs/segments/languages/crystal","draft":false,"unlisted":false,"editUrl":"https://github.com/jandedobbeleer/oh-my-posh/edit/main/website/docs/segments/languages/crystal.mdx","tags":[],"version":"current","frontMatter":{"id":"crystal","title":"Crystal","sidebar_label":"Crystal"},"sidebar":"docs","previous":{"title":"Clojure","permalink":"/docs/segments/languages/clojure"},"next":{"title":"Dart","permalink":"/docs/segments/languages/dart"}}');var r=s(4848),l=s(8453),i=s(6674);const d={id:"crystal",title:"Crystal",sidebar_label:"Crystal"},c=void 0,h={},o=[{value:"What",id:"what",level:2},{value:"Sample Configuration",id:"sample-configuration",level:2},{value:"Options",id:"options",level:2},{value:"Template (info)",id:"template-info",level:2},{value:"Properties",id:"properties",level:3}];function a(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,l.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h2,{id:"what",children:"What"}),"\n",(0,r.jsxs)(t.p,{children:["Display the currently active ",(0,r.jsx)(t.a,{href:"https://crystal-lang.org/",children:"crystal"})," version."]}),"\n",(0,r.jsx)(t.h2,{id:"sample-configuration",children:"Sample Configuration"}),"\n","\n",(0,r.jsx)(i.A,{data:{type:"crystal",style:"powerline",powerline_symbol:"\ue0b0",foreground:"#ffffff",background:"#4063D8",template:" \ue62f {{ .Full }} "}}),"\n",(0,r.jsx)(t.h2,{id:"options",children:"Options"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{style:{textAlign:"center"},children:"Type"}),(0,r.jsx)(t.th,{style:{textAlign:"center"},children:"Default"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"home_enabled"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"boolean"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"false"})}),(0,r.jsx)(t.td,{children:"display the segment in the HOME folder or not"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"cache_duration"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"none"})}),(0,r.jsxs)(t.td,{children:["the duration for which the version will be cached. The duration is a string in the format ",(0,r.jsx)(t.code,{children:"1h2m3s"})," and is parsed using the ",(0,r.jsx)(t.a,{href:"https://golang.org/pkg/time/#ParseDuration",children:"time.ParseDuration"})," function from the Go standard library. To disable the cache, use ",(0,r.jsx)(t.code,{children:"none"})]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"missing_command_text"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"}}),(0,r.jsx)(t.td,{children:"text to display when the command is missing"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"display_mode"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"context"})}),(0,r.jsx)(t.td,{children:(0,r.jsxs)("ul",{children:[(0,r.jsxs)("li",{children:[(0,r.jsx)(t.code,{children:"always"}),": the segment is always displayed"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)(t.code,{children:"files"}),": the segment is only displayed when file ",(0,r.jsx)(t.code,{children:"extensions"})," listed are present"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)(t.code,{children:"context"}),": displays the segment when the environment or files is active"]})]})})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"version_url_template"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"}}),(0,r.jsxs)(t.td,{children:["a go ",(0,r.jsx)(t.a,{href:"https://golang.org/pkg/text/template/",children:"text/template"})," ",(0,r.jsx)(t.a,{href:"/docs/configuration/templates",children:"template"})," that creates the URL of the version info / release notes"]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"extensions"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"[]string"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"*.cr, shard.yml"})}),(0,r.jsx)(t.td,{children:"allows to override the default list of file extensions to validate"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"folders"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"[]string"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"}}),(0,r.jsx)(t.td,{children:"allows to override the list of folder names to validate"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"tooling"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"[]string"})}),(0,r.jsx)(t.td,{style:{textAlign:"center"},children:(0,r.jsx)(t.code,{children:"crystal"})}),(0,r.jsx)(t.td,{children:"the tooling to use for fetching the version"})]})]})]}),"\n",(0,r.jsxs)(t.h2,{id:"template-info",children:["Template (",(0,r.jsx)(t.a,{href:"/docs/configuration/templates",children:"info"}),")"]}),"\n",(0,r.jsx)(t.admonition,{title:"default template",type:"note",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-template",children:"{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}\n"})})}),"\n",(0,r.jsx)(t.h3,{id:"properties",children:"Properties"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:".Full"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{children:"the full version"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:".Major"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{children:"major number"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:".Minor"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{children:"minor number"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:".Patch"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{children:"patch number"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:".URL"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{children:"URL of the version info / release notes"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:".Error"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{children:"error encountered when fetching the version string"})]})]})]})]})}function x(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.