@@ -26,7 +26,7 @@ import path from "path"
2626import { fileURLToPath } from "url"
2727import { Filesystem } from "@/util"
2828import { useLocal } from "@tui/context/local"
29- import { useTheme } from "@tui/context/theme"
29+ import { tint , useTheme } from "@tui/context/theme"
3030import { EmptyBorder , SplitBorder } from "@tui/component/border"
3131import { useSDK } from "@tui/context/sdk"
3232import { useRoute } from "@tui/context/route"
@@ -804,20 +804,26 @@ export function Prompt(props: PromptProps) {
804804 createEffect ( ( ) => {
805805 if ( ! input || input . isDestroyed ) return
806806 if ( props . visible === false || dialog . stack . length > 0 ) {
807- input . blur ( )
807+ if ( input . focused ) input . blur ( )
808808 vimState . clearPending ( )
809809 return
810810 }
811811
812812 // Slot/plugin updates can remount the background prompt while a dialog is open.
813813 // Keep focus with the dialog and let the prompt reclaim it after the dialog closes.
814- input . focus ( )
814+ if ( ! input . focused ) input . focus ( )
815815 } )
816816
817817 createEffect ( ( ) => {
818818 if ( ! input || input . isDestroyed ) return
819+ const capture =
820+ store . mode === "normal"
821+ ? auto ( ) ?. visible
822+ ? ( [ "escape" , "navigate" , "submit" , "tab" ] as const )
823+ : ( [ "tab" ] as const )
824+ : undefined
819825 input . traits = {
820- capture : auto ( ) ?. visible ? [ "escape" , "navigate" , "submit" , "tab" ] : undefined ,
826+ capture,
821827 suspend : ! ! props . disabled || store . mode === "shell" ,
822828 status : store . mode === "shell" ? "SHELL" : undefined ,
823829 }
@@ -1239,6 +1245,7 @@ export function Prompt(props: PromptProps) {
12391245 ( ) => ! ! local . agent . current ( ) && store . mode === "normal" && showVariant ( ) ,
12401246 animationsEnabled ,
12411247 )
1248+ const borderHighlight = createMemo ( ( ) => tint ( theme . border , highlight ( ) , agentMetaAlpha ( ) ) )
12421249
12431250 const placeholderText = createMemo ( ( ) => {
12441251 if ( props . showPlaceholder === false ) return undefined
@@ -1302,7 +1309,7 @@ export function Prompt(props: PromptProps) {
13021309 < box ref = { ( r ) => ( anchor = r ) } visible = { props . visible !== false } >
13031310 < box
13041311 border = { [ "left" ] }
1305- borderColor = { highlight ( ) }
1312+ borderColor = { borderHighlight ( ) }
13061313 customBorderChars = { {
13071314 ...SplitBorder . customBorderChars ,
13081315 bottomLeft : "╹" ,
@@ -1582,11 +1589,10 @@ export function Prompt(props: PromptProps) {
15821589 < Show when = { local . agent . current ( ) } fallback = { < box height = { 1 } /> } >
15831590 { ( agent ) => (
15841591 < >
1585- < text fg = { fadeColor ( highlight ( ) , agentMetaAlpha ( ) ) } >
1586- { store . mode === "shell" ? "Shell" : Locale . titlecase ( agent ( ) . name ) } { " " }
1587- </ text >
1592+ < text fg = { fadeColor ( highlight ( ) , agentMetaAlpha ( ) ) } > { store . mode === "shell" ? "Shell" : Locale . titlecase ( agent ( ) . name ) } </ text >
15881593 < Show when = { store . mode === "normal" } >
15891594 < box flexDirection = "row" gap = { 1 } >
1595+ < text fg = { fadeColor ( theme . textMuted , modelMetaAlpha ( ) ) } > ·</ text >
15901596 < text
15911597 flexShrink = { 0 }
15921598 fg = { fadeColor ( dimmed ( ) ? theme . textMuted : theme . text , modelMetaAlpha ( ) ) }
@@ -1630,7 +1636,7 @@ export function Prompt(props: PromptProps) {
16301636 < box
16311637 height = { 1 }
16321638 border = { [ "left" ] }
1633- borderColor = { highlight ( ) }
1639+ borderColor = { borderHighlight ( ) }
16341640 customBorderChars = { {
16351641 ...EmptyBorder ,
16361642 vertical : theme . backgroundElement . a !== 0 ? "╹" : " " ,
0 commit comments