fix: terminal commands broken — store never initialised, hints disabled - #26
Merged
Merged
Conversation
…nts disabled - vue-web-terminal default export is the component, not the plugin; app.use(component) silently skips install(), so initStore() never runs. Every command hit getStore() → 'store must be initialized' and swallowed the success callback. Switch to createTerminal().app.use(). - useSocketStoreWithOut(app) was called unconditionally, registering a socket Pinia store even when VITE_TERMINAL_WS_URL is unset (production). Guard behind the env-var check; call setupStore(app) directly for Pinia. - enable-example-hint was false, disabling the command autocomplete dropdown entirely. Set to true so users can discover and select commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Terminal commands on promptexecution.com are completely non-functional:
Error: The store must be initialized before readingon every keystrokeRoot Causes (3 bugs)
1. vue-web-terminal plugin never initialised (
src/main.ts)The default export of
vue-web-terminalis the component itself, not the plugin.app.use(component)silently no-ops because the component has noinstall()method. The library'sinstall()— which callsinitStore()— is only available viacreateTerminal(). Without it, every command hitsgetStore()→ throws → the library catches it and swallows thesuccess()callback.2. Socket store registered unconditionally (
src/main.ts)useSocketStoreWithOut(app)was called before the env-var guard, registering a Pinia store that references websocket state even whenVITE_TERMINAL_WS_URLis unset. Fixed by moving it inside the guard and callingsetupStore(app)directly for Pinia.3. Command hints disabled (
src/components/TheXTerm.vue):enable-example-hint="false"disabled the autocomplete dropdown. Set totrue.Testing
Verified on local
vite previewbuild:hello→😁 world(zero console errors)comic→ Win95 shell with Comic/Archive/Subscribe/CLI tabshelp→ full command table listing all 7 commandsh→ autocomplete showshelp+hellowith descriptions; Tab selects