import{r as e}from"./errors-pXKbCKbL.js";import{spawn as t}from"node:child_process";const n={vscode:`code`,code:`code`,cursor:`cursor`,zed:`zed`,sublime:`subl`,subl:`subl`};function r(e){return e?n[e.toLowerCase()]??e:`code`}async function i(n,r){await new Promise((i,a)=>{let o=t(n,[r],{stdio:`inherit`});o.on(`error`,t=>{a(new e(n,t.message))}),o.on(`exit`,t=>{t===0||t===null?i():a(new e(n,`Exited with code ${t}`))})})}export{r as n,i as t};