MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / render

Function render

scripts/dev-select.mjs:48–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46let selected = loadLastChoice()
47
48function render() {
49 process.stdout.write(`\x1b[${options.length}A`)
50 for (let i = 0; i < options.length; i++) {
51 const prefix = i === selected ? '\x1b[36m❯\x1b[0m' : ' '
52 const text = i === selected ? `\x1b[1m${options[i].label}\x1b[0m` : options[i].label
53 process.stdout.write(`\x1b[2K ${prefix} ${text}\n`)
54 }
55}
56
57function run() {
58 console.log('\n\x1b[1mSelect dev mode:\x1b[0m (↑↓ to move, Enter to confirm)\n')

Callers 1

runFunction · 0.70

Calls 1

writeMethod · 0.65

Tested by

no test coverage detected