Sanitize command before execution, not just display (#2122)
The confirm dialog showed a sanitized command (BiDi/zero-width stripped) but executed the raw string, creating a display/consent mismatch. Now the command is sanitized once and the same string is used for both display and execution. Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
This commit is contained in:
parent
5b82041160
commit
57237d9faa
1 changed files with 2 additions and 1 deletions
|
|
@ -13,7 +13,8 @@ struct CmuxConfigExecutor {
|
|||
) {
|
||||
if let workspace = command.workspace {
|
||||
executeWorkspaceCommand(command: command, workspace: workspace, tabManager: tabManager, baseCwd: baseCwd)
|
||||
} else if let shellCommand = command.command {
|
||||
} else if let rawCommand = command.command {
|
||||
let shellCommand = sanitizeForDisplay(rawCommand)
|
||||
let needsConfirm = command.confirm ?? false
|
||||
if needsConfirm, let sourcePath = configSourcePath {
|
||||
let trusted = CmuxDirectoryTrust.shared.isTrusted(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue