diff --git a/aider/commands.py b/aider/commands.py index afe4a117b..722a06951 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -28,8 +28,9 @@ from .dump import dump # noqa: F401 class SwitchCoder(Exception): - def __init__(self, **kwargs): + def __init__(self, placeholder=None, **kwargs): self.kwargs = kwargs + self.placeholder = placeholder class Commands: diff --git a/aider/main.py b/aider/main.py index 2e0299e66..2b26c74a7 100644 --- a/aider/main.py +++ b/aider/main.py @@ -1109,6 +1109,10 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F except SwitchCoder as switch: coder.ok_to_warm_cache = False + # Set the placeholder if provided + if hasattr(switch, 'placeholder') and switch.placeholder is not None: + io.placeholder = switch.placeholder + kwargs = dict(io=io, from_coder=coder) kwargs.update(switch.kwargs) if "show_announcements" in kwargs: