Stefan Haller 2025-03-25 09:32:00 +01:00
parent 7d26a751bd
commit 1eb00d8d14

View file

@ -649,32 +649,39 @@ os:
``` ```
## Custom Command for Opening a Link ## Custom Command for Opening a Link
```yaml ```yaml
os: os:
openLink: 'bash -C /path/to/your/shell-script.sh {{link}}' openLink: 'bash -C /path/to/your/shell-script.sh {{link}}'
``` ```
Specify the external command to invoke when opening URL links (i.e. creating MR/PR in GitLab, BitBucket or GitHub). `{{link}}` will be replaced by the URL to be opened. A simple shell script can be used to further mangle the passed URL. Specify the external command to invoke when opening URL links (i.e. creating MR/PR in GitLab, BitBucket or GitHub). `{{link}}` will be replaced by the URL to be opened. A simple shell script can be used to further mangle the passed URL.
## Custom Command for Copying to and Pasting from Clipboard ## Custom Command for Copying to and Pasting from Clipboard
```yaml ```yaml
os: os:
copyToClipboardCmd: '' 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. 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: If you are working on a terminal that supports OSC52, the following command will let you take advantage of it:
```yaml ```yaml
os: os:
copyToClipboardCmd: printf "\033]52;c;$(printf {{text}} | base64 -w 0)\a" > /dev/tty copyToClipboardCmd: printf "\033]52;c;$(printf {{text}} | base64 -w 0)\a" > /dev/tty
``` ```
For tmux you need to wrap it with the [tmux escape sequence](https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it), and enable passthrough in tmux config with `set -g allow-passthrough on`: For tmux you need to wrap it with the [tmux escape sequence](https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it), and enable passthrough in tmux config with `set -g allow-passthrough on`:
```yaml ```yaml
os: os:
copyToClipboardCmd: printf "\033Ptmux;\033\033]52;c;$(printf {{text}} | base64 -w 0)\a\033\\" > /dev/tty copyToClipboardCmd: printf "\033Ptmux;\033\033]52;c;$(printf {{text}} | base64 -w 0)\a\033\\" > /dev/tty
``` ```
For the best of both worlds, we can let the command determine if we are running in a tmux session and send the correct sequence: For the best of both worlds, we can let the command determine if we are running in a tmux session and send the correct sequence:
```yaml ```yaml
os: os:
copyToClipboardCmd: > copyToClipboardCmd: >
@ -686,10 +693,12 @@ os:
``` ```
A custom command for reading from the clipboard can be set using A custom command for reading from the clipboard can be set using
```yaml ```yaml
os: os:
readFromClipboardCmd: '' readFromClipboardCmd: ''
``` ```
It is used, for example, when pasting a commit message into the commit message panel. The command is supposed to output the clipboard content to stdout. It is used, for example, when pasting a commit message into the commit message panel. The command is supposed to output the clipboard content to stdout.
## Configuring File Editing ## Configuring File Editing
@ -960,6 +969,7 @@ In situations where certain naming pattern is used for branches, this can be use
Example: Example:
Some branches: Some branches:
- jsmith/AB-123 - jsmith/AB-123
- cwilson/AB-125 - cwilson/AB-125