Commit Graph

8 Commits

  • fix(windows) shell_command on windows, minor parsing (#6811)
    ## Summary
    Enables shell_command for windows users, and starts adding some basic
    command parsing here, to at least remove powershell prefixes. We'll
    follow this up with command parsing but I wanted to land this change
    separately with some basic UX.
    
    **NOTE**: This implementation parses bash and powershell on both
    platforms. In theory this is possible, since you can use git bash on
    windows or powershell on linux. In practice, this may not be worth the
    complexity of supporting, so I don't feel strongly about the current
    approach vs. platform-specific branching.
    
    ## Testing
    - [x] Added a bunch of tests 
    - [x] Ran on both windows and os x
  • Colocate more of bash parsing (#6489)
    Move a few callsites that were detecting `bash -lc` into a shared
    helper.
  • Strip zsh -lc wrapper from TUI command headers (#5374)
    Extends shell wrapper stripping in TUI to handle `zsh -lc` in addition
    to `bash -lc`.
    
    Currently, Linux users (and macOS users with zsh profiles) see cluttered
    command headers like `• Ran zsh -lc "echo hello"` instead of `• Ran echo
    hello`. This happens because `codex-rs/tui/src/exec_command.rs` only
    checks for literal `"bash"`, ignoring `zsh` and absolute paths like
    `/usr/bin/zsh`.
    
    **Changes:**
    - Added `is_login_shell_with_lc` helper that extracts shell basename and
    matches against `bash` or `zsh`
    - Updated pattern matching to use the helper instead of hardcoded check
    - Added test coverage for zsh and absolute paths (`/usr/bin/zsh`,
    `/bin/bash`)
    
    **Testing:**
    ```bash
    cd codex-rs
    cargo test strip_bash_lc_and_escape -p codex-tui
    ```
    
    All 4 test cases pass (bash, zsh, and absolute paths for both).
    
    Closes #4201
  • chore: clippy on redundant closure (#4058)
    Add redundant closure clippy rules and let Codex fix it by minimising
    FQP
  • feat: update splash (#3631)
    - Update splash styling.
    - Add center truncation for long paths.
      (Uses new `center_truncate_path` utility.)
    - Update the suggested commands.
    
    
    ## New splash
    <img width="560" height="326" alt="image"
    src="https://github.com/user-attachments/assets/b80d7075-f376-4019-a464-b96a78b0676d"
    />
    
    ## Example with truncation:
    <img width="524" height="317" alt="image"
    src="https://github.com/user-attachments/assets/b023c5cc-0bf0-4d21-9b98-bfea85546eda"
    />
  • chore: upgrade to Rust 1.89 (#2465)
    Codex created this PR from the following prompt:
    
    > upgrade this entire repo to Rust 1.89. Note that this requires
    updating codex-rs/rust-toolchain.toml as well as the workflows in
    .github/. Make sure that things are "clippy clean" as this change will
    likely uncover new Clippy errors. `just fmt` and `cargo clippy --tests`
    are sufficient to check for correctness
    
    Note this modifies a lot of lines because it folds nested `if`
    statements using `&&`.
    
    ---
    [//]: # (BEGIN SAPLING FOOTER)
    Stack created with [Sapling](https://sapling-scm.com). Best reviewed
    with [ReviewStack](https://reviewstack.dev/openai/codex/pull/2465).
    * #2467
    * __->__ #2465
  • feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
    As stated in `codex-rs/README.md`:
    
    Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
    run it. For a number of users, this runtime requirement inhibits
    adoption: they would be better served by a standalone executable. As
    maintainers, we want Codex to run efficiently in a wide range of
    environments with minimal overhead. We also want to take advantage of
    operating system-specific APIs to provide better sandboxing, where
    possible.
    
    To that end, we are moving forward with a Rust implementation of Codex
    CLI contained in this folder, which has the following benefits:
    
    - The CLI compiles to small, standalone, platform-specific binaries.
    - Can make direct, native calls to
    [seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
    [landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
    order to support sandboxing on Linux.
    - No runtime garbage collection, resulting in lower memory consumption
    and better, more predictable performance.
    
    Currently, the Rust implementation is materially behind the TypeScript
    implementation in functionality, so continue to use the TypeScript
    implmentation for the time being. We will publish native executables via
    GitHub Releases as soon as we feel the Rust version is usable.