18 lines
684 B
JavaScript
18 lines
684 B
JavaScript
import { createApp, h } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import { Terminal } from '@xterm/xterm'
|
|
import CLIPopup from '@/components/CLIPopup.vue'
|
|
import { useCLIStore } from '@/stores/cli'
|
|
import '@/style.css'
|
|
// Observe the real xterm instance through its public buffer API; no fake renderer.
|
|
const originalOpen = Terminal.prototype.open
|
|
Terminal.prototype.open = function (...args) {
|
|
window.fixtureTerminal = this
|
|
return originalOpen.apply(this, args)
|
|
}
|
|
const app = createApp({ setup() {
|
|
const cli = useCLIStore()
|
|
return () => h('main', [h('button', { onClick: () => cli.open() }, 'Open terminal'), h(CLIPopup)])
|
|
} })
|
|
app.use(createPinia()); app.mount('#app')
|