1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6438],{7082:(e,s,d)=>{d.d(s,{R:()=>t,x:()=>c});var r=d(758);const n={},i=r.createContext(n);function t(e){const s=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:t(e.components),r.createElement(i.Provider,{value:s},e.children)}},7523:(e,s,d)=>{d.r(s),d.d(s,{assets:()=>h,contentTitle:()=>c,default:()=>j,frontMatter:()=>t,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"plugins/runtime","title":"Runtime","description":"Learn how to use Yazi\'s Lua API.","source":"@site/versioned_docs/version-26.9.1/plugins/runtime.md","sourceDirName":"plugins","slug":"/plugins/runtime","permalink":"/docs/plugins/runtime","draft":false,"unlisted":false,"editUrl":"https://github.com/yazi-rs/yazi-rs.github.io/edit/main/versioned_docs/version-26.9.1/plugins/runtime.md","tags":[],"version":"26.9.1","sidebarPosition":4,"frontMatter":{"sidebar_position":4,"description":"Learn how to use Yazi\'s Lua API."},"sidebar":"docsSidebar","previous":{"title":"Context","permalink":"/docs/plugins/context"},"next":{"title":"Utils","permalink":"/docs/plugins/utils"}}');var n=d(6070),i=d(7082);const t={sidebar_position:4,description:"Learn how to use Yazi's Lua API."},c="Runtime",h={},l=[{value:"rt",id:"rt",level:2},{value:"<code>args</code>",id:"rt.args",level:3},{value:"<code>term</code>",id:"rt.term",level:3},{value:"<code>mgr</code>",id:"rt.mgr",level:3},{value:"<code>plugin</code>",id:"rt.plugin",level:3},{value:"<code>preview</code>",id:"rt.preview",level:3},{value:"<code>tasks</code>",id:"rt.tasks",level:3},{value:"th",id:"th",level:2},{value:"<code>mgr</code>",id:"th.mgr",level:3},{value:"<code>tabs</code>",id:"th.tabs",level:3},{value:"<code>mode</code>",id:"th.mode",level:3},{value:"<code>status</code>",id:"th.status",level:3},{value:"<code>which</code>",id:"th.which",level:3},{value:"<code>confirm</code>",id:"th.confirm",level:3},{value:"<code>spot</code>",id:"th.spot",level:3},{value:"<code>notify</code>",id:"th.notify",level:3},{value:"<code>pick</code>",id:"th.pick",level:3},{value:"<code>input</code>
1",id:"th.input",level:3},{value:"<code>cmp</code>",id:"th.cmp",level:3},{value:"<code>tasks</code>",id:"th.tasks",level:3},{value:"<code>help</code>",id:"th.help",level:3},{value:"rt::Args",id:"rt-args",level:2},{value:"<code>entries</code>",id:"rt-args.entries",level:3},{value:"<code>cwd_file</code>",id:"rt-args.cwd_file",level:3},{value:"<code>chooser_file</code>",id:"rt-args.chooser_file",level:3},{value:"rt::Term",id:"rt-term",level:2},{value:"<code>light()</code>",id:"rt-term.light",level:3},{value:"rt::Plugin",id:"rt-plugin",level:2}];function x(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.header,{children:(0,n.jsx)(s.h1,{id:"runtime",children:"Runtime"})}),"\n",(0,n.jsx)(s.h2,{id:"rt",children:"rt"}),"\n",(0,n.jsxs)(s.p,{children:["You can access Yazi's runtime through ",(0,n.jsx)(s.code,{children:"rt"})," to obtain startup parameters, terminal properties, ",(0,n.jsx)(s.a,{href:"/docs/configuration/yazi",children:"user preferences"}),", etc."]}),"\n",(0,n.jsx)(s.h3,{id:"rt.args",children:(0,n.jsx)(s.code,{children:"args"})}),"\n",(0,n.jsx)(s.p,{children:"Command-line arguments passed by the user when launching Yazi."}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.a,{href:"#rt-args",children:(0,n.jsx)(s.code,{children:"rt::Args"})})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"rt.term",children:(0,n.jsx)(s.code,{children:"term"})}),"\n",(0,n.jsx)(s.p,{children:"User's terminal emulator properties."}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.a,{href:"#rt-term",children:(0,n.jsx)(s.code,{children:"rt::Term"})})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"rt.mgr",children:(0,n.jsx)(s.code,{children:"mgr"})}),"\n",(0,n.jsxs)(s.p,{children:["User preferences under ",(0,n.jsx)(s.a,{href:"/docs/configuration/yazi#mgr",children:"[mgr]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"rt.plugin",children:(0,n.jsx)(s.code,{children:"plugin"})}),"\n",(0,n.jsxs)(s.p,{children:["User preferences under ",(0,n.jsx)(s.a,{href:"/docs/configuration/yazi#plugin",children:"[plugin]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.a,{href:"#rt-plugin",children:(0,n.jsx)(s.code,{children:"rt::Plugin"})})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"rt.preview",children:(0,n.jsx)(s.code,{children:"preview"})}),"\n",(0,n.jsxs)(s.p,{children:["User preferences under ",(0,n.jsx)(s.a,{href:"/docs/configuration/yazi#preview",children:"[preview]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"rt.tasks",children:(0,n.jsx)(s.code,{children:"tasks"})}),"\n",(0,n.jsxs)(s.p,{children:["User preferences under ",(0,n.jsx)(s.a,{href:"/docs/configuration/yazi#tasks",children:"[tasks]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h2,{id:"th",children:"th"}),"\n",(0,n.jsxs)(s.p,{children:["You can access the user's theme and flavor configuration through ",(0,n.jsx)(s.code,{children:"th"}),"."]}),"\n",(0,n.jsx)(s.h3,{id:"th.mgr",children:(0,n.jsx)(s.code,{children:"mgr"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#mgr",children:"[mgr]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.tabs",children:(0,n.jsx)(s.code,{children:"tabs"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#tabs",children:"[tabs]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.mode",children:(0,n.jsx)(s.code,{children:"mode"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#mode",children:"[mode]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.status",children:(0,n.jsx)(s.code,{children:"status"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#
1status",children:"[status]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.which",children:(0,n.jsx)(s.code,{children:"which"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#which",children:"[which]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.confirm",children:(0,n.jsx)(s.code,{children:"confirm"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#confirm",children:"[confirm]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.spot",children:(0,n.jsx)(s.code,{children:"spot"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#spot",children:"[spot]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.notify",children:(0,n.jsx)(s.code,{children:"notify"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#notify",children:"[notify]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.pick",children:(0,n.jsx)(s.code,{children:"pick"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#pick",children:"[pick]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.input",children:(0,n.jsx)(s.code,{children:"input"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#input",children:"[input]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.cmp",children:(0,n.jsx)(s.code,{children:"cmp"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#cmp",children:"[cmp]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.tasks",children:(0,n.jsx)(s.code,{children:"tasks"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#tasks",children:"[tasks]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h3,{id:"th.help",children:(0,n.jsx)(s.code,{children:"help"})}),"\n",(0,n.jsxs)(s.p,{children:["See ",(0,n.jsx)(s.a,{href:"/docs/configuration/theme#help",children:"[help]"}),"."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"table"})})]})})]}),"\n",(0,n.jsx)(s.h2,{id:"rt-args",children:"rt::Args"}),"\n",(0,n.jsx)(s.h3,{id:"rt-args.entries",children:(0,n.jsx)(s.code,{children:"entries"})}),"\n",(0,n.jsx)(s.p,{children:"TODO"}),"\n",(0,n.jsx)(s.h3,{id:"rt-args.cwd_file",children:(0,n.jsx)(s.code,{children:"cwd_file"})}),"\n",(0,n.jsx)(s.p,{children:"TODO"}
1),"\n",(0,n.jsx)(s.h3,{id:"rt-args.chooser_file",children:(0,n.jsx)(s.code,{children:"chooser_file"})}),"\n",(0,n.jsx)(s.p,{children:"TODO"}),"\n",(0,n.jsx)(s.h2,{id:"rt-term",children:"rt::Term"}),"\n",(0,n.jsx)(s.p,{children:"User's terminal emulator properties."}),"\n",(0,n.jsx)(s.h3,{id:"rt-term.light",children:(0,n.jsx)(s.code,{children:"light()"})}),"\n",(0,n.jsxs)(s.p,{children:["Returns whether the terminal is in light mode, or ",(0,n.jsx)(s.code,{children:"nil"})," if the terminal doesn't report a color scheme."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{}),(0,n.jsx)(s.th,{})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Type"}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"fun(): boolean?"})})]})})]}),"\n",(0,n.jsx)(s.h2,{id:"rt-plugin",children:"rt::Plugin"}),"\n",(0,n.jsx)(s.p,{children:"TODO"})]})}function j(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(x,{...e})}):x(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.