CodeEditApp / CodeEditApp/CodeEdit

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

Aberta
#2,151 2 comentários 0 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
Swift
Estrelas
23k
Forks
1.2k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

### 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

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Start by tracing CodeEdit's Git branch detection and the shell command used to populate the Toolbar subtitle; the issue does not name a file or test. Reproduce with an echo statement in ~/.zprofile and an opened Git repository, then verify that only the branch is shown and shell output is excluded.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
git, macos, swift, zsh
Domínio
desktop, developer-experience
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
45/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.