Skip to content

fix: terminal commands broken — store never initialised, hints disabled - #26

Merged
elasticdotventures merged 1 commit into
mainfrom
fix/terminal-command-execution
Sep 21, 2026
Merged

elasticdotventures merged 1 commit into
mainfrom
fix/terminal-command-execution

Conversation

@elasticdotventures

Copy link
Copy Markdown
Member

Problem

Terminal commands on promptexecution.com are completely non-functional:

  1. Typing any command (hello, comic, 😁) and pressing Enter produces no output — the terminal gets stuck in "executing" state
  2. Command autocomplete/suggestions are disabled — users can't discover available commands
  3. Console shows Error: The store must be initialized before reading on every keystroke

Root Causes (3 bugs)

1. vue-web-terminal plugin never initialised (src/main.ts)

The default export of vue-web-terminal is the component itself, not the plugin. app.use(component) silently no-ops because the component has no install() method. The library's install() — which calls initStore() — is only available via createTerminal(). Without it, every command hits getStore() → throws → the library catches it and swallows the success() 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 when VITE_TERMINAL_WS_URL is unset. Fixed by moving it inside the guard and calling setupStore(app) directly for Pinia.

3. Command hints disabled (src/components/TheXTerm.vue)

:enable-example-hint="false" disabled the autocomplete dropdown. Set to true.

Testing

Verified on local vite preview build:

  • hello😁 world (zero console errors)
  • comic → Win95 shell with Comic/Archive/Subscribe/CLI tabs
  • help → full command table listing all 7 commands
  • Typing h → autocomplete shows help + hello with descriptions; Tab selects

…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.
@elasticdotventures
elasticdotventures merged commit b5afef3 into main Sep 21, 2026
1 of 2 checks passed
@elasticdotventures
elasticdotventures deleted the fix/terminal-command-execution branch September 21, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant