跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

提交记录

Merge pull request #12 from jbpenrath/feat/host-terminfo

feat: install host terminfo inside the VM on $TERM change

作者
Sylvain Zimmer
时间
2026/05/26 21:58
提交
d2b1270
这个版本的全部文件

这是一个合并提交,下面是和第一个上一提交相比的改动。

修改agent-vm.sh+17 −0看文件
@@ -88,6 +88,7 @@ _agent_vm_ensure_running() {
8888 limactl stop "$vm_name" &>/dev/null
8989 limactl delete "$vm_name" --force &>/dev/null
9090 rm -f "$AGENT_VM_STATE_DIR/.agent-vm-version-${vm_name}"
91新增: rm -f "$AGENT_VM_STATE_DIR/.agent-vm-term-${vm_name}"
9192 fi
9293
9394 if ! _agent_vm_exists "$vm_name"; then
@@ -157,6 +158,20 @@ _agent_vm_ensure_running() {
157158 limactl start "$vm_name" &>/dev/null
158159 fi
159160
161新增: # Install the host's terminfo entry inside the VM so non-standard terminals
162新增: # (xterm-ghostty, xterm-kitty, …) work correctly. Without this, zsh/ZLE
163新增: # can't decode keys → broken backspace, arrows, etc. Cached per-VM so we only
164新增: # pay the limactl shell roundtrip when $TERM actually changes.
165新增: local term_cache="$AGENT_VM_STATE_DIR/.agent-vm-term-${vm_name}"
166新增: if [[ -n "${TERM:-}" ]] && [[ "$(cat "$term_cache" 2>/dev/null)" != "$TERM" ]] \
167新增: && infocmp -x "$TERM" &>/dev/null; then
168新增: if infocmp -x "$TERM" | limactl shell "$vm_name" sudo tic -x - &>/dev/null; then
169新增: echo "$TERM" > "$term_cache"
170新增: else
171新增: echo "Warning: failed to install '$TERM' terminfo inside VM." >&2
172新增: fi
173新增: fi
174新增:
160175 # Run per-user runtime script if it exists
161176 if [ -f "$AGENT_VM_STATE_DIR/runtime.sh" ]; then
162177 echo "Running user runtime setup..."
@@ -632,6 +647,7 @@ _agent_vm_destroy() {
632647 limactl stop "$vm_name" &>/dev/null
633648 limactl delete "$vm_name" --force &>/dev/null
634649 rm -f "$AGENT_VM_STATE_DIR/.agent-vm-version-${vm_name}"
650新增: rm -f "$AGENT_VM_STATE_DIR/.agent-vm-term-${vm_name}"
635651 echo "VM destroyed."
636652}
637653
@@ -656,6 +672,7 @@ _agent_vm_destroy_all() {
656672 limactl stop "$vm" &>/dev/null
657673 limactl delete "$vm" --force &>/dev/null
658674 rm -f "$AGENT_VM_STATE_DIR/.agent-vm-version-${vm}"
675新增: rm -f "$AGENT_VM_STATE_DIR/.agent-vm-term-${vm}"
659676 done
660677 echo "All VMs destroyed."
661678}