Skip to content

Bug: Windows 下会频繁弹出 git.exe 终端窗口 #24

Closed

Description

@DabengBa

前言:我无法稳定复现,但只要关了CodeG这个现象就会消失。

以下是MIMO和Codex的一致意见:

问题描述

在 Windows 下使用应用时,正常操作过程中会频繁闪现/弹出一个终端窗口,通常对应进程为:
C:\Program Files\Git\cmd\git.exe
这会明显干扰使用体验,看起来像是后台执行 Git 命令时没有隐藏控制台窗口。

怀疑原因

疑似问题点:

  • src-tauri/src/commands/folders.rs
  • 函数:git_check_ignored_paths
  • 位置:约第 1886 行
    该函数当前直接使用:
std::process::Command::new("git")

并直接启动子进程,但没有在 Windows 下设置 CREATE_NO_WINDOW。

而项目中大多数其他外部命令调用,已经统一走了:

crate::process::tokio_command(...)
该封装内部已经处理了 Windows 下的隐藏窗口逻辑。

为什么怀疑这里
git_check_ignored_paths() 会被文件监听/刷新相关逻辑频繁触发,因此很符合“使用过程中经常弹窗”的现象。

Activity

  1. xintaofei commented on Mar 20, 2026

    @xintaofei
    Collaborator

    我大概知道原因了,后台执行命令的问题

  2. xintaofei commented on Mar 20, 2026

    @xintaofei
    Collaborator

    已在0.2.5版本修复,佬有时间可以升级后试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions