From 0cb6f85805cbe14c4d60e47b6948c0767cc9ac99 Mon Sep 17 00:00:00 2001 From: toxic <89965859+toxic-19@users.noreply.github.com> Date: Sun, 29 Mar 2026 22:44:36 +0800 Subject: [PATCH] fix: #143 UTF-8 backspace fix for macOS libedit (#144) --- agents/s01_agent_loop.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/agents/s01_agent_loop.py b/agents/s01_agent_loop.py index 9c953ef..0508800 100644 --- a/agents/s01_agent_loop.py +++ b/agents/s01_agent_loop.py @@ -27,6 +27,17 @@ policy, hooks, and lifecycle controls on top. import os import subprocess +try: + import readline + # #143 UTF-8 backspace fix for macOS libedit + readline.parse_and_bind('set bind-tty-special-chars off') + readline.parse_and_bind('set input-meta on') + readline.parse_and_bind('set output-meta on') + readline.parse_and_bind('set convert-meta off') + readline.parse_and_bind('set enable-meta-keybindings on') +except ImportError: + pass + from anthropic import Anthropic from dotenv import load_dotenv