mirror of
https://github.com/openai/codex.git
synced 2026-05-03 04:42:20 +03:00
fix: truncate long approval prefixes when rendering (#8734)
Fixes inscrutable multiline approval requests: <img width="686" height="844" alt="image" src="https://github.com/user-attachments/assets/cf9493dc-79e6-4168-8020-0ef0fe676d5e" />
This commit is contained in:
committed by
GitHub
parent
dc1a568dc7
commit
8b4d27dfcd
@@ -461,9 +461,13 @@ fn exec_options(
|
||||
.chain(
|
||||
proposed_execpolicy_amendment
|
||||
.filter(|_| features.enabled(Feature::ExecPolicy))
|
||||
.map(|prefix| {
|
||||
.and_then(|prefix| {
|
||||
let rendered_prefix = strip_bash_lc_and_escape(prefix.command());
|
||||
ApprovalOption {
|
||||
if rendered_prefix.contains('\n') || rendered_prefix.contains('\r') {
|
||||
return None;
|
||||
}
|
||||
|
||||
Some(ApprovalOption {
|
||||
label: format!(
|
||||
"Yes, and don't ask again for commands that start with `{rendered_prefix}`"
|
||||
),
|
||||
@@ -474,7 +478,7 @@ fn exec_options(
|
||||
),
|
||||
display_shortcut: None,
|
||||
additional_shortcuts: vec![key_hint::plain(KeyCode::Char('p'))],
|
||||
}
|
||||
})
|
||||
}),
|
||||
)
|
||||
.chain([ApprovalOption {
|
||||
|
||||
Reference in New Issue
Block a user