mirror of
https://github.com/openai/codex.git
synced 2026-10-24 18:18:41 +00:00
# /copy! /copy allows you to copy the latest **complete** message from Codex on the TUI.
12 lines
457 B
Rust
12 lines
457 B
Rust
#[cfg(not(target_os = "android"))]
|
|
pub fn copy_text_to_clipboard(text: &str) -> Result<(), String> {
|
|
let mut cb = arboard::Clipboard::new().map_err(|e| format!("clipboard unavailable: {e}"))?;
|
|
cb.set_text(text.to_string())
|
|
.map_err(|e| format!("clipboard unavailable: {e}"))
|
|
}
|
|
|
|
#[cfg(target_os = "android")]
|
|
pub fn copy_text_to_clipboard(_text: &str) -> Result<(), String> {
|
|
Err("clipboard text copy is unsupported on Android".into())
|
|
}
|