Skip to content

Commit c83aef6

Browse files
committed
tweak: dim the input bar
1 parent 3de07a4 commit c83aef6

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

npm-app/src/cli-handlers/chat.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -276,22 +276,25 @@ function renderChat() {
276276
process.stdout.write(
277277
'\n' + ' '.repeat(sidePadding) + gray('─'.repeat(contentWidth)),
278278
)
279+
// Show placeholder or user input
280+
if (currentInput.length === 0) {
281+
// Show dimmed placeholder when no input
282+
const placeholder = `\x1b[2m${gray('Type your message...')}\x1b[22m`
283+
process.stdout.write(`\n${' '.repeat(sidePadding)}${placeholder}`)
284+
} else {
285+
// Show user input with cursor when typing
286+
const cursor = gray('|')
287+
const inputWithCursor = currentInput + cursor
288+
const wrappedInputLines = wrapLine(inputWithCursor, contentWidth)
279289

280-
const prompt = bold('Type your message: ')
281-
const cursor = currentInput.length === 0 ? gray('|') : ''
282-
process.stdout.write(
283-
`\n${' '.repeat(sidePadding)}${prompt}${currentInput}${cursor}`,
284-
)
290+
wrappedInputLines.forEach((line, index) => {
291+
process.stdout.write(`\n${' '.repeat(sidePadding)}${line}`)
292+
})
293+
}
285294

286295
// Status line with side padding
287296
let statusText = gray('Enter to send • ↑/↓ to scroll • ESC or Ctrl+C to exit')
288297

289-
if (messageQueue.length > 0) {
290-
statusText += gray(
291-
` • ${messageQueue.length} message${messageQueue.length === 1 ? '' : 's'} queued`,
292-
)
293-
}
294-
295298
process.stdout.write(`\n${' '.repeat(sidePadding)}${statusText}`)
296299

297300
process.stdout.write(HIDE_CURSOR)

0 commit comments

Comments
 (0)