Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aider/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ async def recreate_input(self, future=None):
await asyncio.sleep(0)
else:
self.input_task = asyncio.create_task(self.get_input(None, [], [], []))
await asyncio.sleep(0)

async def get_input(
self,
Expand Down
24 changes: 12 additions & 12 deletions aider/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ def get_io(pretty):
# TUI mode - create TUI-specific IO
output_queue = None
input_queue = None
_console_io = get_io(args.pretty)
if args.tui or (args.tui is None and not args.linear_output):
try:
from aider.tui import create_tui_io
Expand All @@ -776,7 +777,7 @@ def get_io(pretty):
print(f"Import error: {e}")
sys.exit(1)
else:
io = get_io(args.pretty)
io = _console_io

# Only do CLI-specific initialization if not in TUI mode
if not args.tui:
Expand Down Expand Up @@ -1258,37 +1259,38 @@ def apply_model_overrides(model_name):
repomap_in_memory=args.map_memory_cache,
linear_output=args.linear_output,
)
_console_coder = coder.clone(io=_console_io)

if args.show_model_warnings:
problem = await models.sanity_check_models(io, main_model)
problem = await models.sanity_check_models(_console_io, main_model)
if problem:
io.tool_output("You can skip this check with --no-show-model-warnings")
_console_io.tool_output("You can skip this check with --no-show-model-warnings")

try:
await io.offer_url(
await _console_io.offer_url(
urls.model_warnings,
"Open documentation url for more info?",
acknowledge=True,
)
io.tool_output()
_console_io.tool_output()
except KeyboardInterrupt:
return await graceful_exit(coder, 1)

if args.git:
git_root = await setup_git(git_root, io)
git_root = await setup_git(git_root, _console_io)
if args.gitignore:
await check_gitignore(git_root, io)
await check_gitignore(git_root, _console_io)

except UnknownEditFormat as err:
io.tool_error(str(err))
await io.offer_url(
_console_io.tool_error(str(err))
await _console_io.offer_url(
urls.edit_formats, "Open documentation about edit formats?", acknowledge=True
)

return await graceful_exit(None, 1)

except ValueError as err:
io.tool_error(str(err))
_console_io.tool_error(str(err))

return await graceful_exit(None, 1)

Expand Down Expand Up @@ -1437,11 +1439,9 @@ def apply_model_overrides(model_name):
except Exception:
# Don't show errors for auto-load to avoid interrupting the user experience
pass

# TUI mode - launch Textual interface
if args.tui:
from aider.tui import launch_tui

return_code = await launch_tui(coder, output_queue, input_queue, args)
return await graceful_exit(coder, return_code)

Expand Down
3 changes: 2 additions & 1 deletion aider/tui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ def on_input_area_submit(self, message: InputArea.Submit):

# Update footer to show processing
footer = self.query_one(AiderFooter)
footer.start_spinner("Thinking...")
if not user_input.startswith("/"):
footer.start_spinner("Thinking...")

self.update_key_hints(generating=True)

Expand Down