aboutsummaryrefslogtreecommitdiffstats
path: root/commands/compose/attach.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/compose/attach.go')
-rw-r--r--commands/compose/attach.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/commands/compose/attach.go b/commands/compose/attach.go
index 2eb8a98d..3f6d124f 100644
--- a/commands/compose/attach.go
+++ b/commands/compose/attach.go
@@ -154,8 +154,14 @@ func (a Attach) openMenu(aerc *widgets.Aerc, args []string) error {
return err
}
- filepicker := exec.Command("sh", "-c", filePickerCmd+" >&3")
- filepicker.ExtraFiles = append(filepicker.ExtraFiles, picks)
+ var filepicker *exec.Cmd
+ if strings.Contains(filePickerCmd, "%f") {
+ filePickerCmd = strings.ReplaceAll(filePickerCmd, "%f", picks.Name())
+ filepicker = exec.Command("sh", "-c", filePickerCmd)
+ } else {
+ filepicker = exec.Command("sh", "-c", filePickerCmd+" >&3")
+ filepicker.ExtraFiles = append(filepicker.ExtraFiles, picks)
+ }
t, err := widgets.NewTerminal(filepicker)
if err != nil {