Skip to content

Commit 65a5d9b

Browse files
committed
Add "CopyToClipboard" command to ConfirmationController
1 parent 82daedb commit 65a5d9b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pkg/gui/controllers/confirmation_controller.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ func (self *ConfirmationController) GetKeybindings(opts types.KeybindingsOpts) [
4747
return nil
4848
},
4949
},
50+
{
51+
Key: opts.GetKey(opts.Config.Universal.CopyToClipboard),
52+
Handler: func() error {
53+
confirmationView := self.c.Views().Confirmation
54+
text := confirmationView.Buffer()
55+
if err := self.c.OS().CopyToClipboard(text); err != nil {
56+
return err
57+
}
58+
59+
self.c.Toast(fmt.Sprintf("content %s", self.c.Tr.CopiedToClipboard))
60+
return nil
61+
},
62+
Description: self.c.Tr.CopyToClipboardMenu,
63+
DisplayOnScreen: true,
64+
},
5065
}
5166

5267
return bindings

0 commit comments

Comments
 (0)