Просмотр исходного кода

fix(tui): keep user input text gray, reset color after enter

Ma 7 месяцев назад
Родитель
Сommit
db92106663
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      packages/cli/src/tui/app.ts

+ 2 - 1
packages/cli/src/tui/app.ts

@@ -220,7 +220,7 @@ export async function launchTui(
   const rl = readline.createInterface({
   const rl = readline.createInterface({
     input: process.stdin,
     input: process.stdin,
     output: process.stdout,
     output: process.stdout,
-    prompt: `${gray}  ❯ ${reset}`,
+    prompt: `${gray}  ❯ `,
   });
   });
 
 
   const cleanup = () => {
   const cleanup = () => {
@@ -246,6 +246,7 @@ export async function launchTui(
   promptInput();
   promptInput();
 
 
   for await (const line of rl) {
   for await (const line of rl) {
+    process.stdout.write(reset);
     const input = line.trim();
     const input = line.trim();
 
 
     if (!input) {
     if (!input) {