aider/aider
Paul Gauthier 71116a771b aider: Added rich library to reset the terminal at the end of main() function.
# Context:
USER: at the end of main() reset the terminal
ASSISTANT: I need to see the contents of `aider/main.py` to make the requested changes. Please provide the content of that file.
USER: Please note that I shared content of these additional files: aider/main.py
ASSISTANT: I apologize for the oversight. I see the content of `aider/main.py` now. To reset the terminal at the end of the `main()` function, you can use the `os.system()` function with the appropriate command for your operating system. Here's the change for `aider/main.py`:

```python
aider/main.py
<<<<<<< ORIGINAL

^C KeyboardInterrupt
USER: no i need pure python. can rich do it?
ASSISTANT: Yes, you can use the `rich` library to reset the terminal using pure Python. First, you need to import the `Console` class from the `rich.console` module. Then, create a `Console` instance and call its `clear()` method at the end of the `main()` function. Here's the change for `aider/main.py`:

```python
aider/main.py
<<<<<<< ORIGINAL
import os
import sys
import argparse
from dotenv import load_dotenv
from aider.coder import Coder
=======
import os
import sys
import argparse
from dotenv import load_dotenv
from aider.coder import Coder
from rich.console import Console
>>>>>>> UPDATED

aider/main.py
<<<<<<< ORIGINAL
    coder.run()
=======
    coder.run()
    console = Console()
    console.clear()
>>>>>>> UPDATED
```

This change imports the `Console` class from the `rich.console` module and adds the `console.clear()` call at the end of the `main()` function to reset the terminal.
2023-05-11 20:43:11 -07:00
..
__init__.py initial 2023-05-09 11:00:32 -07:00
coder.py ensure the Live is stopped if exceptions occur 2023-05-11 20:40:07 -07:00
commands.py noop 2023-05-11 17:22:58 -07:00
dump.py moved into subdir 2023-05-09 10:52:18 -07:00
getinput.py fix 2023-05-10 21:20:04 -07:00
main.py aider: Added rich library to reset the terminal at the end of main() function. 2023-05-11 20:43:11 -07:00
prompts.py sniff when GPT mentions files that are not in the chat, prompt the user to add them 2023-05-10 22:05:00 -07:00
utils.py fix tests and bug 2023-05-11 17:15:19 -07:00