repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/tui.rs
codex-rs/tui2/src/tui.rs
use std::io::IsTerminal; use std::io::Result; use std::io::Stdout; use std::io::stdin; use std::io::stdout; use std::panic; use std::pin::Pin; use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; use crossterm::SynchronizedUpdate; use crossterm::event::DisableBracketedPaste; use cros...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/transcript_multi_click.rs
codex-rs/tui2/src/transcript_multi_click.rs
//! Transcript-relative multi-click selection helpers. //! //! This module implements multi-click selection in terms of the **rendered //! transcript model** (wrapped transcript lines + content columns), not //! terminal buffer coordinates. //! //! Terminal `(row, col)` coordinates are ephemeral: scrolling, resizing, a...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/key_hint.rs
codex-rs/tui2/src/key_hint.rs
use crossterm::event::KeyCode; use crossterm::event::KeyEvent; use crossterm::event::KeyEventKind; use crossterm::event::KeyModifiers; use ratatui::style::Style; use ratatui::style::Stylize; use ratatui::text::Span; #[cfg(test)] const ALT_PREFIX: &str = "⌥ + "; #[cfg(all(not(test), target_os = "macos"))] const ALT_PRE...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/tooltips.rs
codex-rs/tui2/src/tooltips.rs
use lazy_static::lazy_static; use rand::Rng; const RAW_TOOLTIPS: &str = include_str!("../tooltips.txt"); lazy_static! { static ref TOOLTIPS: Vec<&'static str> = RAW_TOOLTIPS .lines() .map(str::trim) .filter(|line| !line.is_empty() && !line.starts_with('#')) .collect(); } pub(crate...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/updates.rs
codex-rs/tui2/src/updates.rs
#![cfg(not(debug_assertions))] use crate::update_action; use crate::update_action::UpdateAction; use chrono::DateTime; use chrono::Duration; use chrono::Utc; use codex_core::config::Config; use codex_core::default_client::create_client; use serde::Deserialize; use serde::Serialize; use std::path::Path; use std::path::...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/update_action.rs
codex-rs/tui2/src/update_action.rs
/// Update action the CLI should perform after the TUI exits. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum UpdateAction { /// Update via `npm install -g @openai/codex@latest`. NpmGlobalLatest, /// Update via `bun install -g @openai/codex@latest`. BunGlobalLatest, /// Update via `brew upgrad...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/color.rs
codex-rs/tui2/src/color.rs
pub(crate) fn is_light(bg: (u8, u8, u8)) -> bool { let (r, g, b) = bg; let y = 0.299 * r as f32 + 0.587 * g as f32 + 0.114 * b as f32; y > 128.0 } pub(crate) fn blend(fg: (u8, u8, u8), bg: (u8, u8, u8), alpha: f32) -> (u8, u8, u8) { let r = (fg.0 as f32 * alpha + bg.0 as f32 * (1.0 - alpha)) as u8; ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/update_prompt.rs
codex-rs/tui2/src/update_prompt.rs
#![cfg(not(debug_assertions))] use crate::history_cell::padded_emoji; use crate::key_hint; use crate::render::Insets; use crate::render::renderable::ColumnRenderable; use crate::render::renderable::Renderable; use crate::render::renderable::RenderableExt as _; use crate::selection_list::selection_option_row; use crate...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/clipboard_copy.rs
codex-rs/tui2/src/clipboard_copy.rs
use tracing::error; #[derive(Debug)] pub enum ClipboardError { ClipboardUnavailable(String), WriteFailed(String), } impl std::fmt::Display for ClipboardError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { ClipboardError::ClipboardUnavailable(msg) =>...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/custom_terminal.rs
codex-rs/tui2/src/custom_terminal.rs
// This is derived from `ratatui::Terminal`, which is licensed under the following terms: // // The MIT License (MIT) // Copyright (c) 2016-2022 Florian Dehau // Copyright (c) 2023-2025 The Ratatui Developers // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and asso...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/list_selection_view.rs
codex-rs/tui2/src/bottom_pane/list_selection_view.rs
use crossterm::event::KeyCode; use crossterm::event::KeyEvent; use crossterm::event::KeyModifiers; use itertools::Itertools as _; use ratatui::buffer::Buffer; use ratatui::layout::Constraint; use ratatui::layout::Layout; use ratatui::layout::Rect; use ratatui::style::Stylize; use ratatui::text::Line; use ratatui::text:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/footer.rs
codex-rs/tui2/src/bottom_pane/footer.rs
#[cfg(target_os = "linux")] use crate::clipboard_paste::is_probably_wsl; use crate::key_hint; use crate::key_hint::KeyBinding; use crate::render::line_utils::prefix_lines; use crate::status::format_tokens_compact; use crate::ui_consts::FOOTER_INDENT_COLS; use crossterm::event::KeyCode; use ratatui::buffer::Buffer; use ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/textarea.rs
codex-rs/tui2/src/bottom_pane/textarea.rs
use crate::key_hint::is_altgr; use crossterm::event::KeyCode; use crossterm::event::KeyEvent; use crossterm::event::KeyModifiers; use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::style::Color; use ratatui::style::Style; use ratatui::widgets::StatefulWidgetRef; use ratatui::widgets::WidgetRef; use st...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/command_popup.rs
codex-rs/tui2/src/bottom_pane/command_popup.rs
use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::widgets::WidgetRef; use super::popup_consts::MAX_POPUP_ROWS; use super::scroll_state::ScrollState; use super::selection_popup_common::GenericDisplayRow; use super::selection_popup_common::render_rows; use crate::render::Insets; use crate::render::Rec...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/file_search_popup.rs
codex-rs/tui2/src/bottom_pane/file_search_popup.rs
use codex_file_search::FileMatch; use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::widgets::WidgetRef; use crate::render::Insets; use crate::render::RectExt; use super::popup_consts::MAX_POPUP_ROWS; use super::scroll_state::ScrollState; use super::selection_popup_common::GenericDisplayRow; use sup...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/scroll_state.rs
codex-rs/tui2/src/bottom_pane/scroll_state.rs
/// Generic scroll/selection state for a vertical list menu. /// /// Encapsulates the common behavior of a selectable list that supports: /// - Optional selection (None when list is empty) /// - Wrap-around navigation on Up/Down /// - Maintaining a scroll window (`scroll_top`) so the selected row stays visible #[derive...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/paste_burst.rs
codex-rs/tui2/src/bottom_pane/paste_burst.rs
use std::time::Duration; use std::time::Instant; // Heuristic thresholds for detecting paste-like input bursts. // Detect quickly to avoid showing typed prefix before paste is recognized const PASTE_BURST_MIN_CHARS: u16 = 3; const PASTE_BURST_CHAR_INTERVAL: Duration = Duration::from_millis(8); const PASTE_ENTER_SUPPRE...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/selection_popup_common.rs
codex-rs/tui2/src/bottom_pane/selection_popup_common.rs
use ratatui::buffer::Buffer; use ratatui::layout::Rect; // Note: Table-based layout previously used Constraint; the manual renderer // below no longer requires it. use ratatui::style::Color; use ratatui::style::Style; use ratatui::style::Stylize; use ratatui::text::Line; use ratatui::text::Span; use ratatui::widgets::W...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/feedback_view.rs
codex-rs/tui2/src/bottom_pane/feedback_view.rs
use std::cell::RefCell; use std::path::PathBuf; use crossterm::event::KeyCode; use crossterm::event::KeyEvent; use crossterm::event::KeyModifiers; use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::style::Stylize; use ratatui::text::Line; use ratatui::text::Span; use ratatui::widgets::Clear; use rata...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/custom_prompt_view.rs
codex-rs/tui2/src/bottom_pane/custom_prompt_view.rs
use crossterm::event::KeyCode; use crossterm::event::KeyEvent; use crossterm::event::KeyModifiers; use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::style::Stylize; use ratatui::text::Line; use ratatui::text::Span; use ratatui::widgets::Clear; use ratatui::widgets::Paragraph; use ratatui::widgets::St...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/queued_user_messages.rs
codex-rs/tui2/src/bottom_pane/queued_user_messages.rs
use crossterm::event::KeyCode; use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::style::Stylize; use ratatui::text::Line; use ratatui::widgets::Paragraph; use crate::key_hint; use crate::render::renderable::Renderable; use crate::wrapping::RtOptions; use crate::wrapping::word_wrap_lines; /// Widget...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/popup_consts.rs
codex-rs/tui2/src/bottom_pane/popup_consts.rs
//! Shared popup-related constants for bottom pane widgets. use crossterm::event::KeyCode; use ratatui::text::Line; use crate::key_hint; /// Maximum number of rows any popup should attempt to display. /// Keep this consistent across all popups for a uniform feel. pub(crate) const MAX_POPUP_ROWS: usize = 8; /// Stan...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/chat_composer_history.rs
codex-rs/tui2/src/bottom_pane/chat_composer_history.rs
use std::collections::HashMap; use crate::app_event::AppEvent; use crate::app_event_sender::AppEventSender; use codex_core::protocol::Op; /// State machine that manages shell-style history navigation (Up/Down) inside /// the chat composer. This struct is intentionally decoupled from the /// rendering widget so the lo...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/bottom_pane_view.rs
codex-rs/tui2/src/bottom_pane/bottom_pane_view.rs
use crate::bottom_pane::ApprovalRequest; use crate::render::renderable::Renderable; use crossterm::event::KeyEvent; use super::CancellationEvent; /// Trait implemented by every view that can be shown in the bottom pane. pub(crate) trait BottomPaneView: Renderable { /// Handle a key event while the view is active....
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/mod.rs
codex-rs/tui2/src/bottom_pane/mod.rs
//! Bottom pane: shows the ChatComposer or a BottomPaneView, if one is active. use std::path::PathBuf; use crate::app_event_sender::AppEventSender; use crate::bottom_pane::queued_user_messages::QueuedUserMessages; use crate::render::renderable::FlexRenderable; use crate::render::renderable::Renderable; use crate::rend...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/prompt_args.rs
codex-rs/tui2/src/bottom_pane/prompt_args.rs
use codex_protocol::custom_prompts::CustomPrompt; use codex_protocol::custom_prompts::PROMPTS_CMD_PREFIX; use lazy_static::lazy_static; use regex_lite::Regex; use shlex::Shlex; use std::collections::HashMap; use std::collections::HashSet; lazy_static! { static ref PROMPT_ARG_REGEX: Regex = Regex::new(r"\$[...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/chat_composer.rs
codex-rs/tui2/src/bottom_pane/chat_composer.rs
use crate::key_hint; use crate::key_hint::KeyBinding; use crate::key_hint::has_ctrl_or_alt; use crossterm::event::KeyCode; use crossterm::event::KeyEvent; use crossterm::event::KeyEventKind; use crossterm::event::KeyModifiers; use ratatui::buffer::Buffer; use ratatui::layout::Constraint; use ratatui::layout::Layout; us...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/approval_overlay.rs
codex-rs/tui2/src/bottom_pane/approval_overlay.rs
use std::collections::HashMap; use std::path::PathBuf; use crate::app_event::AppEvent; use crate::app_event_sender::AppEventSender; use crate::bottom_pane::BottomPaneView; use crate::bottom_pane::CancellationEvent; use crate::bottom_pane::list_selection_view::ListSelectionView; use crate::bottom_pane::list_selection_v...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bottom_pane/skill_popup.rs
codex-rs/tui2/src/bottom_pane/skill_popup.rs
use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::widgets::WidgetRef; use super::popup_consts::MAX_POPUP_ROWS; use super::scroll_state::ScrollState; use super::selection_popup_common::GenericDisplayRow; use super::selection_popup_common::render_rows_single_line; use crate::render::Insets; use crate:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/public_widgets/composer_input.rs
codex-rs/tui2/src/public_widgets/composer_input.rs
//! Public wrapper around the internal ChatComposer for simple, reusable text input. //! //! This exposes a minimal interface suitable for other crates (e.g., //! codex-cloud-tasks) to reuse the mature composer behavior: multi-line input, //! paste heuristics, Enter-to-submit, and Shift+Enter for newline. use crosster...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/public_widgets/mod.rs
codex-rs/tui2/src/public_widgets/mod.rs
pub mod composer_input;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/onboarding/auth.rs
codex-rs/tui2/src/onboarding/auth.rs
#![allow(clippy::unwrap_used)] use codex_core::AuthManager; use codex_core::auth::AuthCredentialsStoreMode; use codex_core::auth::CLIENT_ID; use codex_core::auth::login_with_api_key; use codex_core::auth::read_openai_api_key_from_env; use codex_login::ServerOptions; use codex_login::ShutdownHandle; use codex_login::ru...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/onboarding/mod.rs
codex-rs/tui2/src/onboarding/mod.rs
mod auth; pub mod onboarding_screen; mod trust_directory; pub use trust_directory::TrustDirectorySelection; mod welcome;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/onboarding/onboarding_screen.rs
codex-rs/tui2/src/onboarding/onboarding_screen.rs
use codex_core::AuthManager; use codex_core::config::Config; use codex_core::git_info::get_git_repo_root; use crossterm::event::KeyCode; use crossterm::event::KeyEvent; use crossterm::event::KeyEventKind; use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::prelude::Widget; use ratatui::style::Color; us...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/onboarding/trust_directory.rs
codex-rs/tui2/src/onboarding/trust_directory.rs
use std::path::PathBuf; use codex_core::config::set_project_trust_level; use codex_core::git_info::resolve_root_git_project_for_trust; use codex_protocol::config_types::TrustLevel; use crossterm::event::KeyCode; use crossterm::event::KeyEvent; use crossterm::event::KeyEventKind; use ratatui::buffer::Buffer; use ratatu...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/onboarding/welcome.rs
codex-rs/tui2/src/onboarding/welcome.rs
use crossterm::event::KeyCode; use crossterm::event::KeyEvent; use crossterm::event::KeyEventKind; use crossterm::event::KeyModifiers; use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::prelude::Widget; use ratatui::style::Stylize; use ratatui::text::Line; use ratatui::widgets::Clear; use ratatui::wid...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/chatwidget/interrupts.rs
codex-rs/tui2/src/chatwidget/interrupts.rs
use std::collections::VecDeque; use codex_core::protocol::ApplyPatchApprovalRequestEvent; use codex_core::protocol::ExecApprovalRequestEvent; use codex_core::protocol::ExecCommandBeginEvent; use codex_core::protocol::ExecCommandEndEvent; use codex_core::protocol::McpToolCallBeginEvent; use codex_core::protocol::McpToo...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/chatwidget/tests.rs
codex-rs/tui2/src/chatwidget/tests.rs
use super::*; use crate::app_event::AppEvent; use crate::app_event_sender::AppEventSender; use crate::test_backend::VT100Backend; use crate::tui::FrameRequester; use assert_matches::assert_matches; use codex_common::approval_presets::builtin_approval_presets; use codex_core::AuthManager; use codex_core::CodexAuth; use ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/chatwidget/session_header.rs
codex-rs/tui2/src/chatwidget/session_header.rs
pub(crate) struct SessionHeader { model: String, } impl SessionHeader { pub(crate) fn new(model: String) -> Self { Self { model } } /// Updates the header's model text. pub(crate) fn set_model(&mut self, model: &str) { if self.model != model { self.model = model.to_stri...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/chatwidget/agent.rs
codex-rs/tui2/src/chatwidget/agent.rs
use std::sync::Arc; use codex_core::CodexConversation; use codex_core::ConversationManager; use codex_core::NewConversation; use codex_core::config::Config; use codex_core::protocol::Event; use codex_core::protocol::EventMsg; use codex_core::protocol::Op; use tokio::sync::mpsc::UnboundedSender; use tokio::sync::mpsc::...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/streaming/controller.rs
codex-rs/tui2/src/streaming/controller.rs
use crate::history_cell::HistoryCell; use crate::history_cell::{self}; use ratatui::text::Line; use super::StreamState; /// Controller that manages newline-gated streaming, header emission, and /// commit animation across streams. pub(crate) struct StreamController { state: StreamState, finishing_after_drain:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/streaming/mod.rs
codex-rs/tui2/src/streaming/mod.rs
use std::collections::VecDeque; use ratatui::text::Line; use crate::markdown_stream::MarkdownStreamCollector; pub(crate) mod controller; pub(crate) struct StreamState { pub(crate) collector: MarkdownStreamCollector, queued_lines: VecDeque<Line<'static>>, pub(crate) has_seen_delta: bool, } impl StreamSta...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/tui/job_control.rs
codex-rs/tui2/src/tui/job_control.rs
use std::io::Result; use std::io::stdout; use std::sync::Arc; use std::sync::Mutex; use std::sync::PoisonError; use std::sync::atomic::AtomicBool; use std::sync::atomic::AtomicU16; use std::sync::atomic::Ordering; use crossterm::cursor::MoveTo; use crossterm::cursor::Show; use crossterm::event::KeyCode; use crossterm:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/tui/alt_screen_nesting.rs
codex-rs/tui2/src/tui/alt_screen_nesting.rs
//! Alternate-screen nesting guard. //! //! The main `codex-tui2` UI typically runs inside the terminal’s alternate screen buffer so the //! full viewport can be used without polluting normal scrollback. Some sub-flows (e.g. pager-style //! overlays) also call `enter_alt_screen()`/`leave_alt_screen()` for historical re...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/tui/scrolling.rs
codex-rs/tui2/src/tui/scrolling.rs
//! Inline transcript scrolling primitives. //! //! The TUI renders the transcript as a list of logical *cells* (user prompts, agent responses, //! banners, etc.). Each frame flattens those cells into a sequence of visual lines (after wrapping) //! plus a parallel `line_meta` vector that maps each visual line back to i...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/tui/frame_requester.rs
codex-rs/tui2/src/tui/frame_requester.rs
//! Frame draw scheduling utilities for the TUI. //! //! This module exposes [`FrameRequester`], a lightweight handle that widgets and //! background tasks can clone to request future redraws of the TUI. //! //! Internally it spawns a [`FrameScheduler`] task that coalesces many requests //! into a single notification o...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/tui/frame_rate_limiter.rs
codex-rs/tui2/src/tui/frame_rate_limiter.rs
//! Limits how frequently frame draw notifications may be emitted. //! //! Widgets sometimes call `FrameRequester::schedule_frame()` more frequently than a user can //! perceive. This limiter clamps draw notifications to a maximum of 60 FPS to avoid wasted work. //! //! This is intentionally a small, pure helper so it ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/tui/scrolling/mouse.rs
codex-rs/tui2/src/tui/scrolling/mouse.rs
//! Scroll normalization for mouse wheel/trackpad input. //! //! Terminal scroll events vary widely in event counts per wheel tick, and inter-event timing //! overlaps heavily between wheel and trackpad input. We normalize scroll input by treating //! events as short streams separated by gaps, converting events into li...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/exec_cell/render.rs
codex-rs/tui2/src/exec_cell/render.rs
use std::time::Instant; use super::model::CommandOutput; use super::model::ExecCall; use super::model::ExecCell; use crate::exec_command::strip_bash_lc_and_escape; use crate::history_cell::HistoryCell; use crate::render::highlight::highlight_bash_to_lines; use crate::render::line_utils::prefix_lines; use crate::render...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/exec_cell/model.rs
codex-rs/tui2/src/exec_cell/model.rs
use std::time::Duration; use std::time::Instant; use codex_core::protocol::ExecCommandSource; use codex_protocol::parse_command::ParsedCommand; #[derive(Clone, Debug, Default)] pub(crate) struct CommandOutput { pub(crate) exit_code: i32, /// The aggregated stderr + stdout interleaved. pub(crate) aggregate...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/exec_cell/mod.rs
codex-rs/tui2/src/exec_cell/mod.rs
mod model; mod render; pub(crate) use model::CommandOutput; #[cfg(test)] pub(crate) use model::ExecCall; pub(crate) use model::ExecCell; pub(crate) use render::OutputLinesParams; pub(crate) use render::TOOL_CALL_MAX_LINES; pub(crate) use render::new_active_exec_command; pub(crate) use render::output_lines; pub(crate) ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/bin/md-events2.rs
codex-rs/tui2/src/bin/md-events2.rs
use std::io::Read; use std::io::{self}; fn main() { let mut input = String::new(); if let Err(err) = io::stdin().read_to_string(&mut input) { eprintln!("failed to read stdin: {err}"); std::process::exit(1); } let parser = pulldown_cmark::Parser::new(&input); for event in parser { ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/notifications/osc9.rs
codex-rs/tui2/src/notifications/osc9.rs
use std::fmt; use std::io; use std::io::stdout; use crossterm::Command; use ratatui::crossterm::execute; #[derive(Debug, Default)] pub struct Osc9Backend; impl Osc9Backend { pub fn notify(&mut self, message: &str) -> io::Result<()> { execute!(stdout(), PostNotification(message.to_string())) } } /// ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/notifications/mod.rs
codex-rs/tui2/src/notifications/mod.rs
mod osc9; mod windows_toast; use std::env; use std::io; use codex_core::env::is_wsl; use osc9::Osc9Backend; use windows_toast::WindowsToastBackend; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum NotificationBackendKind { Osc9, WindowsToast, } #[derive(Debug)] pub enum DesktopNotificationBackend { ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/notifications/windows_toast.rs
codex-rs/tui2/src/notifications/windows_toast.rs
use std::io; use std::process::Command; use std::process::Stdio; use base64::Engine as _; use base64::engine::general_purpose::STANDARD as BASE64; const APP_ID: &str = "Codex"; const POWERSHELL_EXE: &str = "powershell.exe"; #[derive(Debug)] pub struct WindowsToastBackend { encoded_title: String, } impl WindowsT...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/render/highlight.rs
codex-rs/tui2/src/render/highlight.rs
use ratatui::style::Style; use ratatui::style::Stylize; use ratatui::text::Line; use ratatui::text::Span; use std::sync::OnceLock; use tree_sitter_highlight::Highlight; use tree_sitter_highlight::HighlightConfiguration; use tree_sitter_highlight::HighlightEvent; use tree_sitter_highlight::Highlighter; // Ref: https://...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/render/renderable.rs
codex-rs/tui2/src/render/renderable.rs
use std::sync::Arc; use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::text::Line; use ratatui::text::Span; use ratatui::widgets::Paragraph; use ratatui::widgets::WidgetRef; use crate::render::Insets; use crate::render::RectExt as _; pub trait Renderable { fn render(&self, area: Rect, buf: &mut...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/render/mod.rs
codex-rs/tui2/src/render/mod.rs
use ratatui::layout::Rect; pub mod highlight; pub mod line_utils; pub mod renderable; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Insets { left: u16, top: u16, right: u16, bottom: u16, } impl Insets { pub fn tlbr(top: u16, left: u16, bottom: u16, right: u16) -> Self { Self { ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/render/line_utils.rs
codex-rs/tui2/src/render/line_utils.rs
use ratatui::text::Line; use ratatui::text::Span; /// Clone a borrowed ratatui `Line` into an owned `'static` line. pub fn line_to_static(line: &Line<'_>) -> Line<'static> { Line { style: line.style, alignment: line.alignment, spans: line .spans .iter() ....
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/status/tests.rs
codex-rs/tui2/src/status/tests.rs
use super::new_status_output; use super::rate_limit_snapshot_display; use crate::history_cell::HistoryCell; use chrono::Duration as ChronoDuration; use chrono::TimeZone; use chrono::Utc; use codex_core::AuthManager; use codex_core::config::Config; use codex_core::config::ConfigBuilder; use codex_core::models_manager::m...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/status/helpers.rs
codex-rs/tui2/src/status/helpers.rs
use crate::exec_command::relativize_to_home; use crate::text_formatting; use chrono::DateTime; use chrono::Local; use codex_app_server_protocol::AuthMode; use codex_core::AuthManager; use codex_core::config::Config; use codex_core::project_doc::discover_project_doc_paths; use codex_protocol::account::PlanType; use std:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/status/mod.rs
codex-rs/tui2/src/status/mod.rs
mod account; mod card; mod format; mod helpers; mod rate_limits; pub(crate) use card::new_status_output; pub(crate) use helpers::format_tokens_compact; pub(crate) use rate_limits::RateLimitSnapshotDisplay; pub(crate) use rate_limits::rate_limit_snapshot_display; #[cfg(test)] mod tests;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/status/format.rs
codex-rs/tui2/src/status/format.rs
use ratatui::prelude::*; use ratatui::style::Stylize; use std::collections::BTreeSet; use unicode_width::UnicodeWidthChar; use unicode_width::UnicodeWidthStr; #[derive(Debug, Clone)] pub(crate) struct FieldFormatter { indent: &'static str, label_width: usize, value_offset: usize, value_indent: String, ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/status/card.rs
codex-rs/tui2/src/status/card.rs
use crate::history_cell::CompositeHistoryCell; use crate::history_cell::HistoryCell; use crate::history_cell::PlainHistoryCell; use crate::history_cell::with_border_with_inner_width; use crate::version::CODEX_CLI_VERSION; use chrono::DateTime; use chrono::Local; use codex_common::create_config_summary_entries; use code...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/status/rate_limits.rs
codex-rs/tui2/src/status/rate_limits.rs
use crate::chatwidget::get_limits_duration; use crate::text_formatting::capitalize_first; use super::helpers::format_reset_timestamp; use chrono::DateTime; use chrono::Duration as ChronoDuration; use chrono::Local; use chrono::Utc; use codex_core::protocol::CreditsSnapshot as CoreCreditsSnapshot; use codex_core::proto...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/src/status/account.rs
codex-rs/tui2/src/status/account.rs
#[derive(Debug, Clone)] pub(crate) enum StatusAccountDisplay { ChatGpt { email: Option<String>, plan: Option<String>, }, ApiKey, }
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/tests/test_backend.rs
codex-rs/tui2/tests/test_backend.rs
#[path = "../src/test_backend.rs"] mod inner; pub use inner::VT100Backend;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/tests/all.rs
codex-rs/tui2/tests/all.rs
// Single integration test binary that aggregates all test modules. // The submodules live in `tests/suite/`. #[cfg(feature = "vt100-tests")] mod test_backend; mod suite;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/tests/suite/vt100_live_commit.rs
codex-rs/tui2/tests/suite/vt100_live_commit.rs
#![cfg(feature = "vt100-tests")] use crate::test_backend::VT100Backend; use ratatui::layout::Rect; use ratatui::text::Line; #[test] fn live_001_commit_on_overflow() { let backend = VT100Backend::new(20, 6); let mut term = match codex_tui::custom_terminal::Terminal::with_options(backend) { Ok(t) => t, ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/tests/suite/mod.rs
codex-rs/tui2/tests/suite/mod.rs
// Aggregates all former standalone integration tests as modules. mod status_indicator; mod vt100_history; mod vt100_live_commit;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/tests/suite/vt100_history.rs
codex-rs/tui2/tests/suite/vt100_history.rs
#![cfg(feature = "vt100-tests")] #![expect(clippy::expect_used)] use crate::test_backend::VT100Backend; use ratatui::layout::Rect; use ratatui::style::Stylize; use ratatui::text::Line; // Small helper macro to assert a collection contains an item with a clearer // failure message. macro_rules! assert_contains { (...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/tui2/tests/suite/status_indicator.rs
codex-rs/tui2/tests/suite/status_indicator.rs
//! Regression test: ensure that `StatusIndicatorWidget` sanitises ANSI escape //! sequences so that no raw `\x1b` bytes are written into the backing //! buffer. Rendering logic is tricky to unit‑test end‑to‑end, therefore we //! verify the *public* contract of `ansi_escape_line()` which the widget now //! relies on. ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/src/event_processor_with_jsonl_output.rs
codex-rs/exec/src/event_processor_with_jsonl_output.rs
use std::collections::HashMap; use std::path::PathBuf; use std::sync::atomic::AtomicU64; use crate::event_processor::CodexStatus; use crate::event_processor::EventProcessor; use crate::event_processor::handle_last_message; use crate::exec_events::AgentMessageItem; use crate::exec_events::CommandExecutionItem; use crat...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/src/lib.rs
codex-rs/exec/src/lib.rs
// - In the default output mode, it is paramount that the only thing written to // stdout is the final message (if any). // - In --json mode, stdout must be valid JSONL, one event per line. // For both modes, any other output must be written to stderr. #![deny(clippy::print_stdout)] mod cli; mod event_processor; mod...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/src/cli.rs
codex-rs/exec/src/cli.rs
use clap::Parser; use clap::ValueEnum; use codex_common::CliConfigOverrides; use std::path::PathBuf; #[derive(Parser, Debug)] #[command(version)] pub struct Cli { /// Action to perform. If omitted, runs a new non-interactive session. #[command(subcommand)] pub command: Option<Command>, /// Optional im...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/src/exec_events.rs
codex-rs/exec/src/exec_events.rs
use mcp_types::ContentBlock as McpContentBlock; use serde::Deserialize; use serde::Serialize; use serde_json::Value as JsonValue; use ts_rs::TS; /// Top-level JSONL events emitted by codex exec #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, TS)] #[serde(tag = "type")] pub enum ThreadEvent { /// Emitted ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/src/main.rs
codex-rs/exec/src/main.rs
//! Entry-point for the `codex-exec` binary. //! //! When this CLI is invoked normally, it parses the standard `codex-exec` CLI //! options and launches the non-interactive Codex agent. However, if it is //! invoked with arg0 as `codex-linux-sandbox`, we instead treat the invocation //! as a request to run the logic fo...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/src/event_processor.rs
codex-rs/exec/src/event_processor.rs
use std::path::Path; use codex_core::config::Config; use codex_core::protocol::Event; use codex_core::protocol::SessionConfiguredEvent; pub(crate) enum CodexStatus { Running, InitiateShutdown, Shutdown, } pub(crate) trait EventProcessor { /// Print summary of effective configuration and user prompt. ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/src/event_processor_with_human_output.rs
codex-rs/exec/src/event_processor_with_human_output.rs
use codex_common::elapsed::format_duration; use codex_common::elapsed::format_elapsed; use codex_core::config::Config; use codex_core::protocol::AgentMessageEvent; use codex_core::protocol::AgentReasoningRawContentEvent; use codex_core::protocol::BackgroundEventEvent; use codex_core::protocol::DeprecationNoticeEvent; u...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/event_processor_with_json_output.rs
codex-rs/exec/tests/event_processor_with_json_output.rs
use codex_core::protocol::AgentMessageEvent; use codex_core::protocol::AgentReasoningEvent; use codex_core::protocol::AskForApproval; use codex_core::protocol::ErrorEvent; use codex_core::protocol::Event; use codex_core::protocol::EventMsg; use codex_core::protocol::ExecCommandBeginEvent; use codex_core::protocol::Exec...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
true
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/all.rs
codex-rs/exec/tests/all.rs
// Single integration test binary that aggregates all test modules. // The submodules live in `tests/suite/`. mod suite; mod event_processor_with_json_output;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/suite/auth_env.rs
codex-rs/exec/tests/suite/auth_env.rs
#![allow(clippy::unwrap_used, clippy::expect_used)] use core_test_support::responses::ev_completed; use core_test_support::responses::mount_sse_once_match; use core_test_support::responses::sse; use core_test_support::responses::start_mock_server; use core_test_support::test_codex_exec::test_codex_exec; use wiremock::m...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/suite/server_error_exit.rs
codex-rs/exec/tests/suite/server_error_exit.rs
#![cfg(not(target_os = "windows"))] #![allow(clippy::expect_used, clippy::unwrap_used)] use core_test_support::responses; use core_test_support::test_codex_exec::test_codex_exec; /// Verify that when the server reports an error, `codex-exec` exits with a /// non-zero status code so automation can detect failures. #[t...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/suite/sandbox.rs
codex-rs/exec/tests/suite/sandbox.rs
#![cfg(unix)] use codex_core::protocol::SandboxPolicy; use codex_core::spawn::StdioPolicy; use codex_utils_absolute_path::AbsolutePathBuf; use std::collections::HashMap; use std::future::Future; use std::io; use std::path::Path; use std::path::PathBuf; use std::process::ExitStatus; use tokio::fs::create_dir_all; use to...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/suite/apply_patch.rs
codex-rs/exec/tests/suite/apply_patch.rs
#![allow(clippy::expect_used, clippy::unwrap_used, unused_imports)] use anyhow::Context; use assert_cmd::prelude::*; use codex_core::CODEX_APPLY_PATCH_ARG1; use core_test_support::responses::ev_apply_patch_custom_tool_call; use core_test_support::responses::ev_apply_patch_function_call; use core_test_support::response...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/suite/originator.rs
codex-rs/exec/tests/suite/originator.rs
#![cfg(not(target_os = "windows"))] #![allow(clippy::expect_used, clippy::unwrap_used)] use codex_core::default_client::CODEX_INTERNAL_ORIGINATOR_OVERRIDE_ENV_VAR; use core_test_support::responses; use core_test_support::test_codex_exec::test_codex_exec; use wiremock::matchers::header; /// Verify that when the server...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/suite/mod.rs
codex-rs/exec/tests/suite/mod.rs
// Aggregates all former standalone integration tests as modules. mod add_dir; mod apply_patch; mod auth_env; mod originator; mod output_schema; mod resume; mod sandbox; mod server_error_exit;
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/suite/output_schema.rs
codex-rs/exec/tests/suite/output_schema.rs
#![cfg(not(target_os = "windows"))] #![allow(clippy::expect_used, clippy::unwrap_used)] use core_test_support::responses; use core_test_support::test_codex_exec::test_codex_exec; use serde_json::Value; #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn exec_includes_output_schema_in_request() -> any...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/suite/add_dir.rs
codex-rs/exec/tests/suite/add_dir.rs
#![cfg(not(target_os = "windows"))] #![allow(clippy::expect_used, clippy::unwrap_used)] use core_test_support::responses; use core_test_support::test_codex_exec::test_codex_exec; /// Verify that the --add-dir flag is accepted and the command runs successfully. /// This test confirms the CLI argument is properly wired...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/exec/tests/suite/resume.rs
codex-rs/exec/tests/suite/resume.rs
#![allow(clippy::unwrap_used, clippy::expect_used)] use anyhow::Context; use core_test_support::test_codex_exec::test_codex_exec; use serde_json::Value; use std::path::Path; use std::string::ToString; use uuid::Uuid; use walkdir::WalkDir; /// Utility: scan the sessions dir for a rollout file that contains `marker` ///...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/windows-sandbox-rs/build.rs
codex-rs/windows-sandbox-rs/build.rs
fn main() { let mut res = winres::WindowsResource::new(); res.set_manifest_file("codex-windows-sandbox-setup.manifest"); let _ = res.compile(); }
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/windows-sandbox-rs/src/cap.rs
codex-rs/windows-sandbox-rs/src/cap.rs
use anyhow::Context; use anyhow::Result; use rand::rngs::SmallRng; use rand::RngCore; use rand::SeedableRng; use serde::Deserialize; use serde::Serialize; use std::fs; use std::path::Path; use std::path::PathBuf; #[derive(Serialize, Deserialize, Clone, Debug)] pub struct CapSids { pub workspace: String, pub re...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/windows-sandbox-rs/src/cwd_junction.rs
codex-rs/windows-sandbox-rs/src/cwd_junction.rs
#![cfg(target_os = "windows")] use codex_windows_sandbox::log_note; use std::collections::hash_map::DefaultHasher; use std::hash::Hash; use std::hash::Hasher; use std::os::windows::fs::MetadataExt as _; use std::os::windows::process::CommandExt as _; use std::path::Path; use std::path::PathBuf; use windows_sys::Win32:...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/windows-sandbox-rs/src/audit.rs
codex-rs/windows-sandbox-rs/src/audit.rs
use crate::acl::add_deny_write_ace; use crate::acl::path_mask_allows; use crate::cap::cap_sid_file; use crate::cap::load_or_create_cap_sids; use crate::logging::{debug_log, log_note}; use crate::policy::SandboxPolicy; use crate::token::convert_string_sid_to_sid; use crate::token::world_sid; use anyhow::anyhow; use anyh...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/windows-sandbox-rs/src/lib.rs
codex-rs/windows-sandbox-rs/src/lib.rs
macro_rules! windows_modules { ($($name:ident),+ $(,)?) => { $(#[cfg(target_os = "windows")] mod $name;)+ }; } windows_modules!( acl, allow, audit, cap, dpapi, env, identity, logging, policy, process, token, winutil ); #[cfg(target_os = "windows")] #[path = "setup_orchestrator.rs"] mod setup; #[c...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/windows-sandbox-rs/src/process.rs
codex-rs/windows-sandbox-rs/src/process.rs
use crate::logging; use crate::winutil::format_last_error; use crate::winutil::quote_windows_arg; use crate::winutil::to_wide; use anyhow::anyhow; use anyhow::Result; use std::collections::HashMap; use std::ffi::c_void; use std::path::Path; use windows_sys::Win32::Foundation::GetLastError; use windows_sys::Win32::Found...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/windows-sandbox-rs/src/allow.rs
codex-rs/windows-sandbox-rs/src/allow.rs
use crate::policy::SandboxPolicy; use dunce::canonicalize; use std::collections::HashMap; use std::collections::HashSet; use std::path::Path; use std::path::PathBuf; #[derive(Debug, Default, PartialEq, Eq)] pub struct AllowDenyPaths { pub allow: HashSet<PathBuf>, pub deny: HashSet<PathBuf>, } pub fn compute_a...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/windows-sandbox-rs/src/setup_main_win.rs
codex-rs/windows-sandbox-rs/src/setup_main_win.rs
#![cfg(target_os = "windows")] use anyhow::Context; use anyhow::Result; use base64::engine::general_purpose::STANDARD as BASE64; use base64::Engine; use codex_windows_sandbox::convert_string_sid_to_sid; use codex_windows_sandbox::ensure_allow_mask_aces_with_inheritance; use codex_windows_sandbox::ensure_allow_write_ac...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/windows-sandbox-rs/src/policy.rs
codex-rs/windows-sandbox-rs/src/policy.rs
use anyhow::Result; pub use codex_protocol::protocol::SandboxPolicy; pub fn parse_policy(value: &str) -> Result<SandboxPolicy> { match value { "read-only" => Ok(SandboxPolicy::ReadOnly), "workspace-write" => Ok(SandboxPolicy::new_workspace_write_policy()), "danger-full-access" | "external-s...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false
openai/codex
https://github.com/openai/codex/blob/279283fe02bf0ce7f93a160db34dd8cf9c8f42c8/codex-rs/windows-sandbox-rs/src/env.rs
codex-rs/windows-sandbox-rs/src/env.rs
use anyhow::{anyhow, Result}; use dirs_next::home_dir; use std::collections::HashMap; use std::env; use std::fs::{self, File}; use std::io::Write; use std::path::{Path, PathBuf}; pub fn normalize_null_device_env(env_map: &mut HashMap<String, String>) { let keys: Vec<String> = env_map.keys().cloned().collect(); ...
rust
Apache-2.0
279283fe02bf0ce7f93a160db34dd8cf9c8f42c8
2026-01-04T15:31:59.292600Z
false