@@ -5,7 +5,7 @@ import path from "path"
55import { fileURLToPath } from "url"
66import { Filesystem } from "@/util"
77import { useLocal } from "@tui/context/local"
8- import { useTheme } from "@tui/context/theme"
8+ import { tint , useTheme } from "@tui/context/theme"
99import { EmptyBorder , SplitBorder } from "@tui/component/border"
1010import { useSDK } from "@tui/context/sdk"
1111import { useRoute } from "@tui/context/route"
@@ -463,19 +463,25 @@ export function Prompt(props: PromptProps) {
463463 createEffect ( ( ) => {
464464 if ( ! input || input . isDestroyed ) return
465465 if ( props . visible === false || dialog . stack . length > 0 ) {
466- input . blur ( )
466+ if ( input . focused ) input . blur ( )
467467 return
468468 }
469469
470470 // Slot/plugin updates can remount the background prompt while a dialog is open.
471471 // Keep focus with the dialog and let the prompt reclaim it after the dialog closes.
472- input . focus ( )
472+ if ( ! input . focused ) input . focus ( )
473473 } )
474474
475475 createEffect ( ( ) => {
476476 if ( ! input || input . isDestroyed ) return
477+ const capture =
478+ store . mode === "normal"
479+ ? auto ( ) ?. visible
480+ ? ( [ "escape" , "navigate" , "submit" , "tab" ] as const )
481+ : ( [ "tab" ] as const )
482+ : undefined
477483 input . traits = {
478- capture : auto ( ) ?. visible ? [ "escape" , "navigate" , "submit" , "tab" ] : undefined ,
484+ capture,
479485 suspend : ! ! props . disabled || store . mode === "shell" ,
480486 status : store . mode === "shell" ? "SHELL" : undefined ,
481487 }
@@ -870,6 +876,7 @@ export function Prompt(props: PromptProps) {
870876 ( ) => ! ! local . agent . current ( ) && store . mode === "normal" && showVariant ( ) ,
871877 animationsEnabled ,
872878 )
879+ const borderHighlight = createMemo ( ( ) => tint ( theme . border , highlight ( ) , agentMetaAlpha ( ) ) )
873880
874881 const placeholderText = createMemo ( ( ) => {
875882 if ( props . showPlaceholder === false ) return undefined
@@ -931,7 +938,7 @@ export function Prompt(props: PromptProps) {
931938 < box ref = { ( r ) => ( anchor = r ) } visible = { props . visible !== false } >
932939 < box
933940 border = { [ "left" ] }
934- borderColor = { highlight ( ) }
941+ borderColor = { borderHighlight ( ) }
935942 customBorderChars = { {
936943 ...SplitBorder . customBorderChars ,
937944 bottomLeft : "╹" ,
@@ -1146,11 +1153,10 @@ export function Prompt(props: PromptProps) {
11461153 < Show when = { local . agent . current ( ) } fallback = { < box height = { 1 } /> } >
11471154 { ( agent ) => (
11481155 < >
1149- < text fg = { fadeColor ( highlight ( ) , agentMetaAlpha ( ) ) } >
1150- { store . mode === "shell" ? "Shell" : Locale . titlecase ( agent ( ) . name ) } { " " }
1151- </ text >
1156+ < text fg = { fadeColor ( highlight ( ) , agentMetaAlpha ( ) ) } > { store . mode === "shell" ? "Shell" : Locale . titlecase ( agent ( ) . name ) } </ text >
11521157 < Show when = { store . mode === "normal" } >
11531158 < box flexDirection = "row" gap = { 1 } >
1159+ < text fg = { fadeColor ( theme . textMuted , modelMetaAlpha ( ) ) } > ·</ text >
11541160 < text
11551161 flexShrink = { 0 }
11561162 fg = { fadeColor ( keybind . leader ? theme . textMuted : theme . text , modelMetaAlpha ( ) ) }
@@ -1183,7 +1189,7 @@ export function Prompt(props: PromptProps) {
11831189 < box
11841190 height = { 1 }
11851191 border = { [ "left" ] }
1186- borderColor = { highlight ( ) }
1192+ borderColor = { borderHighlight ( ) }
11871193 customBorderChars = { {
11881194 ...EmptyBorder ,
11891195 vertical : theme . backgroundElement . a !== 0 ? "╹" : " " ,
0 commit comments