CodeEditApp / CodeEditApp/CodeEdit

🐞 Git Branch detection captures shell outputs rather than just the branch

未關閉
#2,151 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Swift
星號
23k
分支
1.2k
PR 合併指標
30 天內沒有已合併 PR

描述

### Description

In my ZSH configuration (~/.zprofile) I echo text out, this runs when I open a new shell, but the text echoed shows up in the Toolbar's subtitle where it shows the branch.

### To Reproduce

This assumes the same machine configuration as me, since I'm unsure how much of this is CodeEdit's decisions VS my setup, though assuming you run ZSH as your standard shell I'd assume it would replicate properly.

#### open `.zprofile`
```shell
open ~/.zprofile -a CodeEdit
```

#### add an `echo` statement, such as
```shell
echo "This text should not show up in CodeEdit branch info, it should only be seen in interactive shells"
```

#### save `.zprofile`

#### Quite CodeEdit

#### Open a Git initialized repository in CodeEdit

Or make a temporary Git repo and open it...

```shell
setopt INTERACTIVE_COMMENTS
# ↑ allow comments in the shells interactive mode (default off in zsh)

dir="$(mktemp -d)" # makes a temporary folder (so it auto deletes by the OS later)

cd $dir # go to our temporary directory

git init # initialize a Git repository in the directory

open . -a CodeEdit # open our temporary git repo in CodeEdit
```

#### and in the branch section you will see an output like the image attached

### Expected Behavior

CodeEdit runs a non-interactive shell to capture the current branch, and only captures branch info via Git's stdout, rather than the shell contents

### Version Information

CodeEdit: 0.3.6 (47)
macOS: 26.1.0

### Additional Context

_No response_

### Screenshots

Image

貢獻指南

開啟貢獻指南

研究方向

先追蹤 CodeEdit 的 Git 分支偵測,以及用來填入 Toolbar 副標題的 shell 指令;issue 未指定檔案或測試。透過在 ~/.zprofile 中加入 echo 陳述式並開啟 Git 儲存庫來重現,然後確認只顯示分支,且排除 shell 輸出。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
git, macos, swift, zsh
領域
desktop, developer-experience
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。