fix(tui): restore prompt rendering on startup (#498)
* fix(tui): restore prompt rendering on startup * test(tui): document render-time command split * fix(tui): reduce ghostty prompt repaint scope
This commit is contained in:
13
src/state/pluginCommandsStore.ts
Normal file
13
src/state/pluginCommandsStore.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { Command } from '../commands.js'
|
||||
import { createStore } from './store.js'
|
||||
|
||||
const pluginCommandsStore = createStore<Command[]>([])
|
||||
|
||||
export const getPluginCommandsState = (): Command[] =>
|
||||
pluginCommandsStore.getState()
|
||||
|
||||
export const subscribePluginCommands = pluginCommandsStore.subscribe
|
||||
|
||||
export function setPluginCommandsState(commands: Command[]): void {
|
||||
pluginCommandsStore.setState(() => [...commands])
|
||||
}
|
||||
Reference in New Issue
Block a user