44
55from agent_chat_cli .components .thinking_indicator import ThinkingIndicator
66from agent_chat_cli .components .tool_permission_prompt import ToolPermissionPrompt
7+ from agent_chat_cli .components .user_input import UserInput
78
89if TYPE_CHECKING :
910 from agent_chat_cli .app import AgentChatCLIApp
@@ -39,8 +40,6 @@ def stop_thinking(self, show_cursor: bool = True) -> None:
3940 def show_permission_prompt (
4041 self , tool_name : str , tool_input : dict [str , Any ]
4142 ) -> None :
42- from agent_chat_cli .components .user_input import UserInput
43-
4443 thinking_indicator = self .app .query_one (ThinkingIndicator )
4544 thinking_indicator .is_thinking = False
4645
@@ -53,13 +52,20 @@ def show_permission_prompt(
5352 user_input .display = False
5453
5554 def hide_permission_prompt (self ) -> None :
56- from agent_chat_cli .components .user_input import UserInput
57-
5855 permission_prompt = self .app .query_one (ToolPermissionPrompt )
5956 permission_prompt .is_visible = False
6057
6158 user_input = self .app .query_one (UserInput )
6259 user_input .display = True
6360
64- input_widget = self .app .query_one (TextArea )
61+ self .focus_input ()
62+
63+ def focus_input (self ) -> None :
64+ user_input = self .app .query_one (UserInput )
65+ input_widget = user_input .query_one (TextArea )
6566 input_widget .focus ()
67+
68+ def clear_input (self ) -> None :
69+ user_input = self .app .query_one (UserInput )
70+ input_widget = user_input .query_one (TextArea )
71+ input_widget .clear ()
0 commit comments