codex cli/codex app接入第三方api没有代码高亮了吗?

迷糊.YOU 2026-07-11 11:48 1

codex CLI/codex App接入第三方api就看不到高亮edit代码了吗? ^-^

全是命令行,codex官方api就能看到高亮edit编辑/删除代码,第三方api没办法高亮吗? ^-^

最新回复 (2)
  • 迷糊.YOU 楼主 07-11 21:55
    1

    啊哈,我知道怎么解决了,终于解决了

  • 句号 07-12 00:23
    2

    用这个提示词可以解决这个问题


    # Global Codex Rules

    These rules apply across all repositories for every model.

    ## File edits (mandatory)

    1. Always create, update, or delete project files with the `apply_patch` tool.
    2. Never write files through shell or scripting fallbacks:
    - no `Set-Content`, `Out-File`, `Add-Content`, `New-Item -Value`
    - no redirection (`>`, `>>`)
    - no Python/Node `write_text` / `open(...).write`
    - no `cat` / heredoc file creation for project code
    3. Shell is only for inspection and commands: read files, search, git, compile, run tests, install deps.
    4. If `apply_patch` fails, fix the patch and retry `apply_patch`. Do not switch to shell writes.

    ## Exact apply_patch format

    - First line must be exactly: `*** Begin Patch`
    - Never write: `*** Begin Patch ***`
    - End with: `*** End Patch`
    - Prefer absolute file paths in headers
    - Prefer small, correct patches over one large freeform rewrite

    Example:

    ```text
    *** Begin Patch
    *** Update File: D:\path\to\file.py
    @@
    -old
    +new
    *** End Patch

    Why this matters


    Successful apply_patch is what makes VS Code Codex show:



    • +N / -M line counts

    • Review

    • Undo


    Shell file writes can change files, but they skip the structured diff UI.


    Git / Undo


    Keep work inside a git worktree when possible. Undo depends on git history and repository safety checks.


* 帖子来源Linux.do
返回