mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
aider: Replaced console.reset()
with reset_terminal()
from rich.console
module to reset the terminal without clearing the screen.
# Context: USER: AttributeError: 'Console' object has no attribute 'reset' ASSISTANT: I apologize for the confusion. It seems I made a mistake in my previous suggestion. The `rich` library does not have a `reset()` method for the `Console` object. Instead, you can use the `reset_terminal()` function from the `rich.console` module. Here's the change for `aider/main.py`: ```python aider/main.py <<<<<<< ORIGINAL from rich.console import Console ======= from rich.console import Console, reset_terminal >>>>>>> UPDATED aider/main.py <<<<<<< ORIGINAL console = Console() console.reset() ======= reset_terminal() >>>>>>> UPDATED ``` This change imports the `reset_terminal()` function from the `rich.console` module and replaces the `console.reset()` call with `reset_terminal()` at the end of the `main()` function to reset the terminal without clearing the screen.
This commit is contained in:
parent
0ef2790464
commit
dabda6c5ea
1 changed files with 2 additions and 3 deletions
|
@ -3,7 +3,7 @@ import sys
|
|||
import argparse
|
||||
from dotenv import load_dotenv
|
||||
from aider.coder import Coder
|
||||
from rich.console import Console
|
||||
from rich.console import Console, reset_terminal
|
||||
|
||||
|
||||
def main(args=None):
|
||||
|
@ -88,8 +88,7 @@ def main(args=None):
|
|||
return
|
||||
|
||||
coder.run()
|
||||
console = Console()
|
||||
console.reset()
|
||||
reset_terminal()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue