1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-23 22:24:51 +02:00

feat: add os.copyToClipboardCmd to allow for a custom command

Issue #1055

test: CopyPatchToClipboard (temporary commit for review)
This commit is contained in:
Red S
2023-07-16 08:57:02 +00:00
committed by Jesse Duffield
parent 7e9f669421
commit d7f84aed8a
6 changed files with 70 additions and 50 deletions

View File

@@ -106,6 +106,7 @@ git:
parseEmoji: false
diffContextSize: 3 # how many lines of context are shown around a change in diffs
os:
copyToClipboardCmd: '' # See 'Custom Command for Copying to Clipboard' section
editPreset: '' # see 'Configuring File Editing' section
edit: ''
editAtLine: ''
@@ -278,6 +279,20 @@ os:
open: 'open {{filename}}'
```
### Custom Command for Copying to Clipboard
```yaml
os:
copyToClipboardCmd: ''
```
Specify an external command to invoke when copying to clipboard is requested. `{{text}` will be replaced by text to be copied. Default is to copy to system clipboard.
If you are working on a terminal that supports OSC52, the following command will let you take advantage of it:
```
os:
copyToClipboardCmd: printf "\033]52;c;$(printf {{text}} | base64)\a" > /dev/tty
```
### Configuring File Editing
There are two commands for opening files, `o` for "open" and `e` for "edit". `o`