"use strict";(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[8511],{26758:(e,t,n)=>{n.r(t),n.d(t,{Actions:()=>r,TerminalActions:()=>r});var c=n(78089),s=n(26616),a=n(35789);class r extends s.e{constructor(){super(...arguments),this.doctype="none"}_init2(){}_raw_default_frame_tree(){return{type:"terminal"}}get_terminal(e){return this.terminals.get(e)}run_command(e,t){const{run:n=!0,cleanup:c=!0,userarg:s=!1,special:a}=t,r=this._get_most_recent_active_frame_id_of_type("terminal");if(null!=r){this.unset_frame_full(),this.focus(r),this.set_active_id(r);const t=this.terminals.get(r);if(null==t)return;switch(a){case"up":t.conn_write("[A");break;case"down":t.conn_write("[B");break;case"tab":t.conn_write("\t");break;case"ctrl-c":t.conn_write("");break;default:const a=n&&!s?"\n":s?"":" ",r=c?"":"",i=s?" ''[D":"";t.conn_write(`${r}${e}${i}${a}`)}}}help(){(0,a.open_new_tab)("https://doc.cocalc.com/terminal.html")}guide(){return e=this,null,t=function*(){const e=this.show_focused_frame_of_type("commands_guide","col",!1,3/4);yield(0,c.delay)(0),"closed"!==this._state&&this.set_active_id(e,!0)},new Promise(((n,c)=>{var s=e=>{try{r(t.next(e))}catch(e){c(e)}},a=e=>{try{r(t.throw(e))}catch(e){c(e)}},r=e=>e.done?n(e.value):Promise.resolve(e.value).then(s,a);r((t=t.apply(e,null)).next())}));var e,t}}}}]);