v1.3.0
The main changes in this release center on branches and the Git pane. Worktree sessions can now check out an existing branch instead of always creating a new one, the diff view gains a unified mode alongside the existing split layout, and we fixed a memory blowup that could crash the app when opening the Git pane on repos with huge untracked trees.
The remaining changes are focused on making everyday operations smoother:
- Session tabs now keep their branch names up to date when the branch changes outside the app.
- Cmd+click on a link in any terminal pane opens it with your system's default application.
Download Codelegate v1.3.0 here
Check Out an Existing Branch in Worktree Sessions
The New Session dialog now includes a branch picker for worktree sessions. Instead of always starting from an auto-created branch, you can pick any local branch and the session worktree checks it out directly, leaving your original repository checkout untouched. Branches already checked out elsewhere appear disabled and labeled with where they are in use, so the same branch never ends up active in two places.
Session cleanup follows the same rule: removing a worktree session deletes only auto-created branches and preserves the ones you picked yourself. The persisted worktree configuration keeps this behavior consistent across restarts.
Unified Diff View
The Git pane's diff area now offers a unified view alongside the existing split view, switchable with a Split/Unified toggle next to the diff stats. Unified mode merges both sides into a single column with old and new line numbers in the gutter. It reuses the same syntax highlighting and virtualized rendering as the split view, so large diffs stay fast in either mode.
Fixing Memory Blowups on Huge Untracked Trees
Opening the Git pane on a repository with large untracked directories (a package store, an embedded database) or oversized files used to read every untracked byte into memory on each scan, and every per-file diff request repeated that full scan. With diff cards auto-opening, this could stack up to roughly twenty concurrent full-repository scans and crash the app.
This release reworks that path:
- Untracked directories are collapsed to a single entry, matching how
git statuspresents them, and staged in one operation. - Untracked file reads are capped at 2 MiB behind a shared gate, binaries are detected from the first 8 KiB, and tracked files over 2 MiB are treated as binary.
- Per-file diff requests are scoped to the file itself instead of rescanning the whole section.
- Diff payloads are capped at 4000 rows, with a notice shown when a diff is truncated.
- Diff cards are materialized lazily as they scroll into view, and concurrent summary loads are coalesced into a single follow-up run.
As a data point, a summary scan of a tree with 20,000 untracked files plus a 286 MB log file now completes in 185 ms with a 29.5 MB peak memory footprint.
Other Improvements
- Session branch monitoring: each session's branch name is refreshed periodically and whenever the window regains focus, so a branch switch made by an agent or in another terminal shows up in the tab without a manual refresh.
- Cmd+click to open terminal links: holding Cmd (Ctrl on other platforms) and clicking a URL in any pane opens it with your system's default application. A plain click no longer triggers navigation.
v1.3.0
這個版本的改動主要圍繞在分支與 Git 面板:worktree session 現在可以直接 checkout 既有的分支,差異檢視在原本的左右對照之外新增了 unified 模式,同時修正了在含有大量未追蹤檔案的 repo 開啟 Git 面板時可能導致 app 當掉的記憶體暴增問題。
其餘的改動則集中在讓日常操作更順手:
- session 分頁的分支名稱會隨外部的分支切換自動更新。
- 在任何終端機面板中 Cmd+點擊連結,即可用系統預設應用程式開啟。
Worktree Session 可 Checkout 既有分支
新增 session 的對話方塊現在提供分支選單:worktree session 不再只能從自動建立的分支開始,你可以直接選擇任何本地分支,session 的 worktree 會 checkout 該分支,原本 repo 的 checkout 則完全不受影響。已經在其他位置 checkout 的分支會以停用狀態顯示並標明所在位置,避免同一個分支同時出現在兩個地方。
session 的清理邏輯也遵循相同原則:移除 worktree session 時只會刪除自動建立的分支,你自己選擇的分支則予以保留。這個行為會記錄在 worktree 設定中,重啟後依然一致。
Unified 差異檢視
Git 面板的差異區域除了原本的 split(左右對照)檢視外,新增了 unified(單欄)模式,可透過差異統計旁的 Split/Unified 切換鈕切換。unified 模式會將新舊兩側合併為單欄,並在行號欄同時顯示新舊行號。它沿用與 split 檢視相同的語法標示與虛擬化捲動,因此大型差異在兩種模式下都能保持流暢。
修正大量未追蹤檔案造成的記憶體暴增
過去在含有大型未追蹤資料夾(例如套件快取、內嵌資料庫)或超大檔案的 repo 開啟 Git 面板時,每次掃描都會將所有未追蹤的內容完整讀進記憶體,而每個檔案的差異請求又會重複整份掃描;在差異卡片自動展開的情況下,可能同時堆疊約二十個全 repo 掃描並使 app 當掉。
這個版本重新設計了整個流程:
- 未追蹤的資料夾會如同
git status一樣收合為單一項目,並以單次操作 stage。 - 未追蹤檔案的讀取上限為 2 MiB 並由共用的閘門控管,二進位檔案由開頭 8 KiB 判斷,超過 2 MiB 的已追蹤檔案一律視為二進位。
- 單一檔案的差異請求只針對該檔案本身,不再重新掃描整個區段。
- 差異內容上限為 4000 列,遭截斷時會顯示提示。
- 差異卡片改為捲動到可視範圍時才實際載入,同時進行的摘要載入也會合併為單次後續執行。
以實際數據為例,一個含有兩萬個未追蹤檔案外加一個 286 MB 記錄檔的 repo,摘要掃描現在只需 185 ms,記憶體用量尖峰約 29.5 MB。
其他改善
- 分支變更監控 :每個 session 的分支名稱會定期更新,視窗重新取得焦點時也會立即更新,因此由 agent 或其他終端機所做的分支切換會直接反映在分頁上。
- Cmd+點擊開啟終端機連結 :在任何面板中按住 Cmd(其他平台為 Ctrl)點擊網址,即可用系統預設應用程式開啟;單純點擊不再觸發任何開啟行為。